Skip to content

Commit 9a321be

Browse files
committed
fix: other switches not toggling when they should
1 parent 30e531d commit 9a321be

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/Adaptor/Settings/SettingsItem.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,14 @@ class SettingSwitchItemState extends State<SettingSwitchItem> {
7575
_isChecked = widget.setting.isChecked;
7676
}
7777

78+
@override
79+
void didUpdateWidget(covariant SettingSwitchItem oldWidget) {
80+
if (oldWidget.setting.isChecked != widget.setting.isChecked) {
81+
setState(() => _isChecked = widget.setting.isChecked);
82+
}
83+
super.didUpdateWidget(oldWidget);
84+
}
85+
7886
@override
7987
Widget build(BuildContext context) {
8088
if (!widget.setting.isVisible) return const SizedBox.shrink();

0 commit comments

Comments
 (0)