Home > front end >  I'm having trouble fixing chechboxlisttile in flutter
I'm having trouble fixing chechboxlisttile in flutter

Time:08-20

I can't seems to fine a good solution fixing checkboxlisttile in flutter, i'm a complete beginner working with flutter i went through the flutter docs screenshot screenshot

Please i needed help in understanding this checkboxlisttile thing.

CodePudding user response:

onChanged provides nullable bool

final ValueChanged<bool?>? onChanged;

onChanged: (bool? value){
 isChecked = value ?? false;
} 

CodePudding user response:

I assume you want to toggle between true and false upon clicking the CheckBoxListTile.

Edit the following code inside your onChanged:

onChanged: (bool? value){
 isChecked = !isChecked;
} 
  • Related