2022-06-16 20:30:02 +00:00
|
|
|
import 'package:flutter/material.dart';
|
2022-06-28 20:05:24 +00:00
|
|
|
import 'package:intl/intl.dart';
|
2022-06-17 10:38:28 +00:00
|
|
|
import 'package:localization/localization.dart';
|
2022-06-16 20:30:02 +00:00
|
|
|
import 'package:slothmu/partials/main_scaffold.dart';
|
|
|
|
import 'pages/login.dart';
|
2022-06-17 12:13:45 +00:00
|
|
|
import 'package:flutter_localizations/flutter_localizations.dart';
|
2022-06-16 20:30:02 +00:00
|
|
|
|
2022-06-28 20:05:24 +00:00
|
|
|
void main() {
|
|
|
|
Intl.defaultLocale = 'en_US';
|
|
|
|
|
|
|
|
runApp(const Slothmu());
|
|
|
|
}
|
2022-06-17 12:13:45 +00:00
|
|
|
|
|
|
|
class Slothmu extends StatefulWidget {
|
|
|
|
const Slothmu({Key? key}) : super(key: key);
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<Slothmu> createState() => _SlothmuState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _SlothmuState extends State<Slothmu> {
|
2022-06-28 20:05:24 +00:00
|
|
|
List<Locale> supported = const [
|
|
|
|
Locale("en", "US"),
|
|
|
|
Locale("de", "DE"),
|
|
|
|
];
|
2022-06-17 12:13:45 +00:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
LocalJsonLocalization.delegate.directories = ['lib/i18n'];
|
|
|
|
return MaterialApp(
|
2022-06-28 20:05:24 +00:00
|
|
|
supportedLocales: supported,
|
2022-06-17 10:38:28 +00:00
|
|
|
localizationsDelegates: [
|
2022-06-17 12:13:45 +00:00
|
|
|
GlobalCupertinoLocalizations.delegate,
|
|
|
|
GlobalWidgetsLocalizations.delegate,
|
|
|
|
GlobalMaterialLocalizations.delegate,
|
2022-06-17 10:38:28 +00:00
|
|
|
LocalJsonLocalization.delegate,
|
|
|
|
],
|
2022-06-16 20:30:02 +00:00
|
|
|
initialRoute: '/login',
|
|
|
|
routes: {
|
|
|
|
'/': (context) => const MainScaffold(),
|
|
|
|
'/login': (context) => const Login(),
|
|
|
|
},
|
2022-06-17 12:13:45 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|