make toggleValue nullable

This commit is contained in:
ashilkn 2022-11-23 11:23:37 +05:30
parent 7cee5e1b70
commit 25195e369c

View file

@ -26,7 +26,7 @@ class ToggleSwitchWidget extends StatefulWidget {
}
class _ToggleSwitchWidgetState extends State<ToggleSwitchWidget> {
late bool toggleValue;
bool? toggleValue;
ExecutionState executionState = ExecutionState.idle;
final _debouncer = Debouncer(const Duration(milliseconds: 300));
@ -96,7 +96,7 @@ class _ToggleSwitchWidgetState extends State<ToggleSwitchWidget> {
});
}
} else {
toggleValue = !toggleValue;
toggleValue = !toggleValue!;
executionState = ExecutionState.idle;
}
});