diff --git a/lib/settings.dart b/lib/settings.dart index db286c60..665e3f3a 100644 --- a/lib/settings.dart +++ b/lib/settings.dart @@ -90,6 +90,7 @@ class Settings extends ChangeNotifier { bool get useSemanticDebugger => _useSemanticDebugger; String? _themeId; + String? get themeId => _themeId; String? _mode; OpaqueThemeType get theme => themeloader.getTheme(_themeId, _mode); void setTheme(String themeId, String mode) { @@ -483,7 +484,7 @@ class Settings extends ChangeNotifier { dynamic asJson() { return { "Locale": this.locale.toString(), - "Theme": theme.theme, + "Theme": _themeId, "ThemeMode": theme.mode, "ThemeImages": _themeImages, "PreviousPid": -1, diff --git a/lib/themes/yamltheme.dart b/lib/themes/yamltheme.dart index 7e32b529..a7e8f9c1 100644 --- a/lib/themes/yamltheme.dart +++ b/lib/themes/yamltheme.dart @@ -132,7 +132,7 @@ class YmlTheme extends OpaqueThemeType { val = yml["themes"][mode]["theme"][val] ?? val; } if (!(val is int)) { - val = yml["themes"][mode]?["colors"][val] ?? val; + val = yml["themes"][mode]?["colors"]?[val] ?? val; } if (!(val is int)) { val = yml["colors"]?[val]; diff --git a/lib/views/globalsettingsappearanceview.dart b/lib/views/globalsettingsappearanceview.dart index 416d6bab..b15973fd 100644 --- a/lib/views/globalsettingsappearanceview.dart +++ b/lib/views/globalsettingsappearanceview.dart @@ -92,7 +92,7 @@ class _GlobalSettingsAppearanceViewState extends State( key: Key("DropdownTheme"), isExpanded: true, - value: Provider.of(context).theme.theme, + value: Provider.of(context).themeId, onChanged: (String? newValue) { setState(() { settings.setTheme(newValue!, settings.theme.mode); @@ -102,7 +102,7 @@ class _GlobalSettingsAppearanceViewState extends State>((String themeId) { return DropdownMenuItem( value: themeId, - child: Text(getThemeName(context, themeId), style: settings.scaleFonts(defaultDropDownMenuItemTextStyle)), //"ddi_$themeId", key: Key("ddi_$themeId")), + child: Text(getThemeName(context, settings, themeId), style: settings.scaleFonts(defaultDropDownMenuItemTextStyle)), //"ddi_$themeId", key: Key("ddi_$themeId")), ); }).toList())), leading: Icon(Icons.palette, color: settings.current().mainTextColor), @@ -330,7 +330,7 @@ class _GlobalSettingsAppearanceViewState extends State