From 6b8cc2569d33389148dc56a826bc3e46e40a9ba1 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Tue, 12 May 2020 19:08:08 +0200 Subject: [PATCH] Fix issue on first start --- lib/helpers/preferences_helper.dart | 3 +-- lib/models/application_preferences.dart | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/helpers/preferences_helper.dart b/lib/helpers/preferences_helper.dart index 62e08f7..a2bad80 100644 --- a/lib/helpers/preferences_helper.dart +++ b/lib/helpers/preferences_helper.dart @@ -74,8 +74,7 @@ class PreferencesHelper { /// Get all settings as an [ApplicationPreferences] object ApplicationPreferences get preferences => ApplicationPreferences( - enableDarkMode: - getBool(PreferencesKeyList.ENABLE_DARK_THEME, alternative: null), + enableDarkMode: getBool(PreferencesKeyList.ENABLE_DARK_THEME), ); } diff --git a/lib/models/application_preferences.dart b/lib/models/application_preferences.dart index 36f221e..151d9ac 100644 --- a/lib/models/application_preferences.dart +++ b/lib/models/application_preferences.dart @@ -9,5 +9,5 @@ class ApplicationPreferences { const ApplicationPreferences({ @required this.enableDarkMode, - }); + }) : assert(enableDarkMode != null); }