diff --git a/lib/entities/universal_slider.widget.dart b/lib/entities/universal_slider.widget.dart index c66066c..767a21b 100644 --- a/lib/entities/universal_slider.widget.dart +++ b/lib/entities/universal_slider.widget.dart @@ -28,10 +28,10 @@ class UniversalSliderState extends State { double _value; bool _changeStarted = false; + bool _changedHere = false; @override void initState() { - _value = widget.value; super.initState(); } @@ -39,6 +39,11 @@ class UniversalSliderState extends State { Widget build(BuildContext context) { List row = []; List col = []; + if (!_changedHere) { + _value = widget.value; + } else { + _changedHere = false; + } if (widget.leading != null) { row.add(widget.leading); } @@ -57,6 +62,7 @@ class UniversalSliderState extends State { onChanged: (value) { setState(() { _value = value; + _changedHere = true; }); widget.onChanged?.call(value); }, @@ -64,6 +70,7 @@ class UniversalSliderState extends State { _changeStarted = false; setState(() { _value = value; + _changedHere = true; }); Timer(Duration(milliseconds: 500), () { if (!_changeStarted) { diff --git a/lib/main.dart b/lib/main.dart index 32cfa6c..c73ce93 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -159,7 +159,7 @@ EventBus eventBus = new EventBus(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin = new FlutterLocalNotificationsPlugin(); const String appName = 'HA Client'; -const appVersionNumber = '1.0.1'; +const appVersionNumber = '1.1.0'; final String appVersionAdd = secrets['version_type'] ?? ''; final String appVersion = '$appVersionNumber${appVersionAdd.isNotEmpty ? '-' : ''}$appVersionAdd'; const whatsNewUrl = 'http://ha-client.app/service/whats_new_1.0.1.md'; diff --git a/lib/managers/app_settings.dart b/lib/managers/app_settings.dart index bb7fa65..46cce8a 100644 --- a/lib/managers/app_settings.dart +++ b/lib/managers/app_settings.dart @@ -36,8 +36,9 @@ class AppSettings { appTheme = AppTheme.values[prefs.getInt('app-theme') ?? AppTheme.defaultTheme.index]; } - Future load(bool quick) async { - if (!quick) { + Future load(bool full) async { + if (full) { + Logger.d('Loading settings...'); SharedPreferences prefs = await SharedPreferences.getInstance(); _domain = prefs.getString('hassio-domain'); _port = prefs.getString('hassio-port'); @@ -53,6 +54,7 @@ class AppSettings { locationUpdateInterval = Duration(minutes: prefs.getInt("location-interval") ?? defaultLocationUpdateIntervalMinutes); locationTrackingEnabled = prefs.getBool("location-enabled") ?? false; + Logger.d('Done. $_domain:$_port'); try { final storage = new FlutterSecureStorage(); longLivedToken = await storage.read(key: "hacl_llt"); diff --git a/lib/managers/connection_manager.class.dart b/lib/managers/connection_manager.class.dart index e7283a6..1aacea9 100644 --- a/lib/managers/connection_manager.class.dart +++ b/lib/managers/connection_manager.class.dart @@ -27,7 +27,9 @@ class ConnectionManager { Future init({bool loadSettings, bool forceReconnect: false}) { Completer completer = Completer(); AppSettings().load(loadSettings).then((_) { + Logger.d('Checking config...'); if (AppSettings().isNotConfigured()) { + Logger.d('This is first start'); completer.completeError(HACNotSetUpException()); } else if (AppSettings().isSomethingMissed()) { completer.completeError(HACException.checkConnectionSettings());