Home > Software design >  FlutterStates/Screen becomes empty/when fixing => The argument type 'Function' can'
FlutterStates/Screen becomes empty/when fixing => The argument type 'Function' can'

Time:11-02

FlutterStates/Screen becomes empty/when fixing => Code

Blank screen

CodePudding user response:

Try changing final Function currentCheckBoxState; to final Function(bool?) currentCheckBoxState;

and in your void Function make your bool nullable with a ? and make a null check inside the setState with ! behind currentCheckBoxState void checkBoxCallBack(bool? currentCheckBoxState) { setState(() {isChecked = currentCheckBoxState!; }); }

  • Related