This commit is contained in:
zoe 2022-07-02 00:41:37 +02:00
parent d0f02d1ad6
commit 061e12b285

View file

@ -3,11 +3,18 @@ import 'package:intl/intl.dart';
import 'package:localization/localization.dart';
import 'package:slothmu/partials/main_scaffold.dart';
import 'pages/login.dart';
import 'business_logic/settings.dart' as settings;
import 'package:flutter_localizations/flutter_localizations.dart';
void main() {
String initRoute = "/";
void main() async {
Intl.defaultLocale = 'en_US';
// check if all information is available
if (await settings.loadAuthCode() == "") {
initRoute = "/login";
}
runApp(const Slothmu());
}
@ -34,7 +41,7 @@ class _SlothmuState extends State<Slothmu> {
GlobalMaterialLocalizations.delegate,
LocalJsonLocalization.delegate,
],
initialRoute: '/login',
initialRoute: initRoute,
routes: {
'/': (context) => const MainScaffold(),
'/login': (context) => const Login(),