Skip to content

Commit 22f68fc

Browse files
committed
Allow clicking anywhere on a ToggleOption, instead of only the checkbox
Fixes a regression caused in 3233c5a
1 parent ff825c8 commit 22f68fc

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

lib/project_view/configs/views/base.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,7 @@ class _Option extends StatefulWidget {
182182
final Widget? button;
183183
final bool shouldPadBottom;
184184
final bool enabled;
185+
final GestureTapCallback? onTap;
185186

186187
const _Option({
187188
required this.title,
@@ -191,6 +192,7 @@ class _Option extends StatefulWidget {
191192
this.button,
192193
this.shouldPadBottom = false,
193194
this.enabled = true,
195+
this.onTap,
194196
});
195197

196198
@override
@@ -224,6 +226,7 @@ class _OptionState extends State<_Option> {
224226
: widget.subtitle,
225227
trailing: widget.button,
226228
tileColor: hovered ? hoverColour : null,
229+
onTap: widget.onTap,
227230
),
228231
);
229232

@@ -592,6 +595,11 @@ class ToggleOption extends StatelessWidget {
592595
tristate: !enabled,
593596
fillColor: !enabled ? .all(Colors.grey) : null,
594597
),
598+
onTap: () {
599+
final bool? newValue = value;
600+
if (newValue == null) return;
601+
onChanged(!newValue);
602+
},
595603
);
596604
}
597605
}

0 commit comments

Comments
 (0)