From eaec7340dbb284ef9914430ca28de4a54b5b3e8d Mon Sep 17 00:00:00 2001 From: MohammadTaha Basiri Date: Thu, 31 Mar 2022 00:09:13 +0430 Subject: [PATCH] silence interval bug on previews versions fixed --- .../general_settings/settings_state.dart | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/views/home/settings/general_settings/settings_state.dart b/lib/views/home/settings/general_settings/settings_state.dart index 5a58cf0..4448efb 100644 --- a/lib/views/home/settings/general_settings/settings_state.dart +++ b/lib/views/home/settings/general_settings/settings_state.dart @@ -73,12 +73,17 @@ class GeneralSettingsState extends CoreProvier { Future getSettingsFromStorage() async { appState = AppState.busy; - _notificationTimeRange[0] = int.parse( - await StorageService.getValue(key: 'notificationTimeRangeStart'), - ); - _notificationTimeRange[1] = int.parse( - await StorageService.getValue(key: 'notificationTimeRangeEnd'), - ); + try { + _notificationTimeRange[0] = int.parse( + await StorageService.getValue(key: 'notificationTimeRangeStart'), + ); + _notificationTimeRange[1] = int.parse( + await StorageService.getValue(key: 'notificationTimeRangeEnd'), + ); + } catch (e) { + notificationTimeRange = [0, 0]; + } + _fontFamily = await StorageService.getValue(key: 'fontFamily'); _brightness = await StorageService.getValue(key: 'brightness'); final scale = await StorageService.getValue(key: 'fontSizeScale');