Skip to content

Commit 5c0a707

Browse files
author
Martijn Oosterhuis
committed
Dubbele terugknop fix
Typfout en bug gefixt
1 parent 0caa83c commit 5c0a707

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

lib/src/ui/tabs/Instellingen.dart

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ class SwitchInstelling extends StatelessWidget {
4141
final String setting;
4242
final String subtitle;
4343
final Function onChange;
44+
final bool disabled;
4445

45-
SwitchInstelling({this.title, this.setting, this.subtitle, this.onChange});
46+
SwitchInstelling({this.title, this.setting, this.subtitle, this.onChange, this.disabled});
4647

4748
Widget build(BuildContext context) {
4849
return SeeCard(
@@ -61,12 +62,14 @@ class SwitchInstelling extends StatelessWidget {
6162
),
6263
value: userdata.get(setting),
6364
activeColor: userdata.get("accentColor"),
64-
onChanged: (value) {
65-
if (onChange != null) onChange();
66-
setState(() {
67-
userdata.put(setting, value);
68-
});
69-
},
65+
onChanged: disabled ?? false // sam grote dom
66+
? null
67+
: (value) {
68+
if (onChange != null) onChange();
69+
setState(() {
70+
userdata.put(setting, value);
71+
});
72+
},
7073
title: Text(title),
7174
);
7275
},
@@ -479,9 +482,10 @@ class _Instellingen extends State<Instellingen> {
479482
onChange: () => appState.setState(() {}),
480483
),
481484
SwitchInstelling(
482-
title: "Dubble terugknop voor agenda",
485+
disabled: !userdata.get("backOpensDrawer"),
486+
title: "Dubbele terugknop voor agenda",
483487
subtitle: "Open de agenda als je twee keer snel op de terugknop klikt",
484-
setting: "doubleBackAgenda",
488+
setting: userdata.get("backOpensDrawer") ? "doubleBackAgenda" : "backOpensDrawer",
485489
onChange: () => appState.setState(() {}),
486490
),
487491
if (accounts.length > 1)

0 commit comments

Comments
 (0)