diff --git a/lib/src/model/app_settings.dart b/lib/src/model/app_settings.dart index 6d4ab47..55c5626 100644 --- a/lib/src/model/app_settings.dart +++ b/lib/src/model/app_settings.dart @@ -4,10 +4,10 @@ import 'package:flutter/material.dart'; import 'package:quickgui/src/supported_locales.dart'; class AppSettings extends ChangeNotifier { - ThemeMode? _themeMode; + ThemeMode _themeMode = ThemeMode.light; String? _activeLocale; - ThemeMode get themeMode => _themeMode ?? ThemeMode.system; + ThemeMode get themeMode => _themeMode; String get activeLocale => _activeLocale ?? Platform.localeName; @@ -38,8 +38,7 @@ class AppSettings extends ChangeNotifier { } set useDarkModeSilently(bool useDarkMode) { - //_themeMode = useDarkMode ? ThemeMode.dark : ThemeMode.light; - _themeMode = ThemeMode.light; + _themeMode = useDarkMode ? ThemeMode.dark : ThemeMode.light; } set useDarkMode(bool useDarkMode) { diff --git a/lib/src/widgets/left_menu.dart b/lib/src/widgets/left_menu.dart index 76035e8..0e72076 100644 --- a/lib/src/widgets/left_menu.dart +++ b/lib/src/widgets/left_menu.dart @@ -48,18 +48,27 @@ class _LeftMenuState extends State with PreferencesMixin { title: Text("Quickgui $_version", style: Theme.of(context).textTheme.titleLarge), ), - /* const Divider(), Padding( padding: const EdgeInsets.symmetric(horizontal: 16), child: Row( children: [ - Text(context.t('Use dark mode')), + Text(context.t('Use dark mode'), + style: TextStyle( + color: Colors.grey[300], + ), + ), Expanded( child: Container(), ), Switch( value: Theme.of(context).colorScheme.brightness == Brightness.dark, + onChanged: null, + activeColor: Colors.grey[300], + activeTrackColor: Colors.grey[300], + inactiveThumbColor: Colors.grey[300], + inactiveTrackColor: Colors.grey[300], + /* onChanged: (value) { appSettings.useDarkMode = value; savePreference(prefThemeMode, value); @@ -68,11 +77,11 @@ class _LeftMenuState extends State with PreferencesMixin { activeTrackColor: Colors.black26, inactiveThumbColor: Theme.of(context).colorScheme.onPrimary, inactiveTrackColor: Theme.of(context).colorScheme.primary, + */ ), ], ), ), - */ const Divider(), Padding( padding: const EdgeInsets.symmetric(horizontal: 16),