The argument type 'void Function(bool)' can't be assigned to the parameter type 'void Function(bool?)?'
Hi i'm using this library and when I integret it with my code then it gives this type of error i dont knw why im getting this please help mi.
The argument type 'void Function(bool)' can't be assigned to the parameter type 'void Function(bool?)?'
onSelectChanged: (bool value) {
if (dessert.selected != value) {
setState(() {
dessert.selected = value;
});
}
},
@Shubham-Narkhede The problem is the boolean, which get's passed into your function, it may be null.
Reason for that is the following code:
onChanged: (bool? value) {
setState(() {
widget.rows[index].onSelectChanged!(value);
});
},
Look here for reference: data_tables
So you're code must look like the following:
onSelectChanged: (bool? value) {
if (dessert.selected != value) {
setState(() {
dessert.selected = value;
});
}
},
Could you open a PR?
@rodydavis do you mean to make this one explizit not-nullable? So that the version off @Shubham-Narkhede is valid?