Skip to content

Commit 8e059e7

Browse files
committed
fix: resolve a regression in theme settings
This commit resolves a regression introduced in commit 1c312d9 that causes exception when toggling the 'Dynamic Theme' setting on and off.
1 parent 901bd97 commit 8e059e7

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/components/settings/drop_down_menu_item.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class _DropDownMenuItemState extends State<DropDownMenuItem> {
4040
trailing: DropdownButton<int>(
4141
value: value,
4242
onChanged: (int? newValue) {
43-
if (newValue != null) {
43+
if (newValue != null && newValue != value) {
4444
GStorage.settings.put(widget.boxKey, newValue);
4545
setState(() => value = newValue);
4646
if (widget.forceAppUpdate) {

lib/pages/settings/settings_page.dart

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,9 @@ class _SettingsPageState extends State<SettingsPage>
122122
defaultValue: true,
123123
forceAppUpdate: true,
124124
),
125-
if (!GStorage.useMaterial)
126-
DropDownMenuItem(
125+
Visibility(
126+
visible: !GStorage.useMaterial,
127+
child: DropDownMenuItem(
127128
icon: Icons.format_color_fill,
128129
title: 'Theme Color',
129130
boxKey: SettingsBoxKey.staticColor,
@@ -135,6 +136,7 @@ class _SettingsPageState extends State<SettingsPage>
135136
.toList(),
136137
forceAppUpdate: true,
137138
),
139+
),
138140
const DropDownMenuItem(
139141
icon: Icons.dark_mode_outlined,
140142
title: 'Dark Mode',

0 commit comments

Comments
 (0)