cleanup
This commit is contained in:
parent
d0f02d1ad6
commit
061e12b285
1 changed files with 9 additions and 2 deletions
|
@ -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(),
|
||||
|
|
Loading…
Reference in a new issue