Fix startup crash

This commit is contained in:
Yegor Vialov 2020-04-11 20:25:54 +03:00 committed by GitHub
parent fba4017819
commit f2563a0397
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -168,7 +168,7 @@ void main() async {
SyncfusionLicense.registerLicense(secrets['syncfusion_license_key']);
FlutterError.onError = (FlutterErrorDetails details) {
Logger.e(" Caut Flutter runtime error: ${details.exception}");
Logger.e("Caut Flutter runtime error: ${details.exception}");
if (Logger.isInDebugMode) {
FlutterError.dumpErrorToConsole(details);
}
@ -177,7 +177,7 @@ void main() async {
WidgetsFlutterBinding.ensureInitialized();
SharedPreferences prefs = await SharedPreferences.getInstance();
AppTheme theme = AppTheme.values[prefs.getInt('app-theme') ?? AppTheme.defaultTheme];
AppTheme theme = AppTheme.values[prefs.getInt('app-theme') ?? AppTheme.defaultTheme.index];
runZoned(() {
runApp(new HAClientApp(