Skip to content

Commit 732986f

Browse files
committed
fix duplicate key bug in theme switcher
1 parent 3c9f118 commit 732986f

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

lib/config/theme_switcher_clipper.dart

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,15 @@ class _ThemeSwitcherClipperState extends State<ThemeSwitcherClipper> {
3131
width: 60,
3232
height: 60,
3333
child: Center(
34-
child: AnimatedSwitcher(
35-
duration: const Duration(seconds: 2),
36-
child: Icon(
37-
widget.isDarkMode ? Icons.dark_mode : Icons.light_mode,
38-
key: ValueKey<bool>(widget.isDarkMode),
39-
color: widget.isDarkMode ? Colors.white : Colors.black,
40-
size: 40,
41-
),
34+
child: AnimatedSwitcher(
35+
duration: const Duration(seconds: 2),
36+
child: Icon(
37+
widget.isDarkMode ? Icons.dark_mode : Icons.light_mode,
38+
key: UniqueKey(),
39+
color: widget.isDarkMode ? Colors.white : Colors.black,
40+
size: 40,
4241
),
43-
),
42+
)),
4443
),
4544
),
4645
),

0 commit comments

Comments
 (0)