Skip to content

Commit d872a8c

Browse files
authored
Merge pull request #160 from Sudhanva-Nadiger/dev
fix: make checkbox clearly visible onclick
2 parents 8e4bff5 + da93a46 commit d872a8c

File tree

1 file changed

+133
-105
lines changed

1 file changed

+133
-105
lines changed

lib/Components/bottom_floating_menu_button.dart

Lines changed: 133 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -220,65 +220,78 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
220220
SizedBox(
221221
height: 20,
222222
),
223-
CheckboxListTile(
224-
activeColor: ThemeProvider
225-
.theme.primaryColorDark,
226-
tileColor: ThemeProvider
227-
.theme.primaryColorLight,
228-
shape: RoundedRectangleBorder(
229-
borderRadius:
230-
BorderRadius.circular(8),
231-
),
232-
title: Text(
233-
'Use as Base Path',
234-
style: TextStyle(fontSize: 14),
223+
StatefulBuilder(
224+
builder: (BuildContext context,
225+
StateSetter _setState) =>
226+
CheckboxListTile(
227+
activeColor: ThemeProvider
228+
.theme.primaryColorDark,
229+
tileColor: ThemeProvider
230+
.theme.primaryColorLight,
231+
shape: RoundedRectangleBorder(
232+
borderRadius:
233+
BorderRadius.circular(8),
234+
),
235+
title: Text(
236+
'Use as Base Path',
237+
style: TextStyle(fontSize: 14),
238+
),
239+
value: useAdBasePath,
240+
onChanged: (bool? value) {
241+
_setState(() {
242+
useAdBasePath = value ?? false;
243+
});
244+
},
235245
),
236-
value: useAdBasePath,
237-
onChanged: (bool? value) {
238-
setState(() {
239-
useAdBasePath = value ?? false;
240-
});
241-
},
242246
),
243-
CheckboxListTile(
244-
activeColor: ThemeProvider
245-
.theme.primaryColorDark,
246-
tileColor: ThemeProvider
247-
.theme.primaryColorLight,
248-
shape: RoundedRectangleBorder(
249-
borderRadius:
250-
BorderRadius.circular(8),
251-
),
252-
title: Text(
253-
'Sequential Download',
254-
style: TextStyle(fontSize: 14),
247+
StatefulBuilder(
248+
builder: (BuildContext context,
249+
StateSetter _setState) =>
250+
CheckboxListTile(
251+
activeColor: ThemeProvider
252+
.theme.primaryColorDark,
253+
tileColor: ThemeProvider
254+
.theme.primaryColorLight,
255+
shape: RoundedRectangleBorder(
256+
borderRadius:
257+
BorderRadius.circular(8),
258+
),
259+
title: Text(
260+
'Sequential Download',
261+
style: TextStyle(fontSize: 14),
262+
),
263+
value: sequentialDownload,
264+
onChanged: (bool? value) {
265+
_setState(() {
266+
sequentialDownload =
267+
value ?? false;
268+
});
269+
},
255270
),
256-
value: sequentialDownload,
257-
onChanged: (bool? value) {
258-
setState(() {
259-
sequentialDownload = value ?? false;
260-
});
261-
},
262271
),
263-
CheckboxListTile(
264-
activeColor: ThemeProvider
265-
.theme.primaryColorDark,
266-
tileColor: ThemeProvider
267-
.theme.primaryColorLight,
268-
shape: RoundedRectangleBorder(
269-
borderRadius:
270-
BorderRadius.circular(8),
271-
),
272-
title: Text(
273-
'Completed',
274-
style: TextStyle(fontSize: 14),
272+
StatefulBuilder(
273+
builder: (BuildContext context,
274+
StateSetter _setState) =>
275+
CheckboxListTile(
276+
activeColor: ThemeProvider
277+
.theme.primaryColorDark,
278+
tileColor: ThemeProvider
279+
.theme.primaryColorLight,
280+
shape: RoundedRectangleBorder(
281+
borderRadius:
282+
BorderRadius.circular(8),
283+
),
284+
title: Text(
285+
'Completed',
286+
style: TextStyle(fontSize: 14),
287+
),
288+
value: completed,
289+
onChanged: (bool? value) {
290+
_setState(() {
291+
completed = value ?? false;
292+
});
293+
},
275294
),
276-
value: completed,
277-
onChanged: (bool? value) {
278-
setState(() {
279-
completed = value ?? false;
280-
});
281-
},
282295
),
283296
SizedBox(
284297
height: 15,
@@ -496,62 +509,77 @@ class _BottomFloatingMenuButtonState extends State<BottomFloatingMenuButton>
496509
SizedBox(
497510
height: 20,
498511
),
499-
CheckboxListTile(
500-
activeColor:
501-
ThemeProvider.theme.primaryColorDark,
502-
tileColor:
503-
ThemeProvider.theme.primaryColorLight,
504-
shape: RoundedRectangleBorder(
505-
borderRadius: BorderRadius.circular(8),
506-
),
507-
title: Text(
508-
'Use as Base Path',
509-
style: TextStyle(fontSize: 14),
512+
StatefulBuilder(
513+
builder: (BuildContext context,
514+
StateSetter _setState) =>
515+
CheckboxListTile(
516+
activeColor: ThemeProvider
517+
.theme.primaryColorDark,
518+
tileColor: ThemeProvider
519+
.theme.primaryColorLight,
520+
shape: RoundedRectangleBorder(
521+
borderRadius:
522+
BorderRadius.circular(8),
523+
),
524+
title: Text(
525+
'Use as Base Path',
526+
style: TextStyle(fontSize: 14),
527+
),
528+
value: useAdBasePath,
529+
onChanged: (bool? value) {
530+
_setState(() {
531+
useAdBasePath = value ?? false;
532+
});
533+
},
510534
),
511-
value: useAdBasePath,
512-
onChanged: (bool? value) {
513-
setState(() {
514-
useAdBasePath = value ?? false;
515-
});
516-
},
517535
),
518-
CheckboxListTile(
519-
activeColor:
520-
ThemeProvider.theme.primaryColorDark,
521-
tileColor:
522-
ThemeProvider.theme.primaryColorLight,
523-
shape: RoundedRectangleBorder(
524-
borderRadius: BorderRadius.circular(8),
525-
),
526-
title: Text(
527-
'Sequential Download',
528-
style: TextStyle(fontSize: 14),
536+
StatefulBuilder(
537+
builder: (BuildContext context,
538+
StateSetter _setState) =>
539+
CheckboxListTile(
540+
activeColor: ThemeProvider
541+
.theme.primaryColorDark,
542+
tileColor: ThemeProvider
543+
.theme.primaryColorLight,
544+
shape: RoundedRectangleBorder(
545+
borderRadius:
546+
BorderRadius.circular(8),
547+
),
548+
title: Text(
549+
'Sequential Download',
550+
style: TextStyle(fontSize: 14),
551+
),
552+
value: sequentialDownload,
553+
onChanged: (bool? value) {
554+
_setState(() {
555+
sequentialDownload = value ?? false;
556+
});
557+
},
529558
),
530-
value: sequentialDownload,
531-
onChanged: (bool? value) {
532-
setState(() {
533-
sequentialDownload = value ?? false;
534-
});
535-
},
536559
),
537-
CheckboxListTile(
538-
activeColor:
539-
ThemeProvider.theme.primaryColorDark,
540-
tileColor:
541-
ThemeProvider.theme.primaryColorLight,
542-
shape: RoundedRectangleBorder(
543-
borderRadius: BorderRadius.circular(8),
544-
),
545-
title: Text(
546-
'Completed',
547-
style: TextStyle(fontSize: 14),
560+
StatefulBuilder(
561+
builder: (BuildContext context,
562+
StateSetter _setState) =>
563+
CheckboxListTile(
564+
activeColor: ThemeProvider
565+
.theme.primaryColorDark,
566+
tileColor: ThemeProvider
567+
.theme.primaryColorLight,
568+
shape: RoundedRectangleBorder(
569+
borderRadius:
570+
BorderRadius.circular(8),
571+
),
572+
title: Text(
573+
'Completed',
574+
style: TextStyle(fontSize: 14),
575+
),
576+
value: completed,
577+
onChanged: (bool? value) {
578+
_setState(() {
579+
completed = value ?? false;
580+
});
581+
},
548582
),
549-
value: completed,
550-
onChanged: (bool? value) {
551-
setState(() {
552-
completed = value ?? false;
553-
});
554-
},
555583
),
556584
SizedBox(
557585
height: 15,

0 commit comments

Comments
 (0)