Unhandled Exception: type 'List<dynamic>' is not a subtype of type 'List<bool>'
E/flutter ( 5907): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: type 'List<dynamic>' is not a subtype of type 'List<bool>'
E/flutter ( 5907): #0 Customers.getfirestore.<anonymous closure>
package: ///.dart:35
E/flutter ( 5907): #1 _rootRunUnary (dart:async/zone.dart:1134:38)
E/flutter ( 5907): #2 _CustomZone.runUnary (dart:async/zone.dart:1031:19)
E/flutter ( 5907): #3 _CustomZone.runUnaryGuarded (dart:async/zone.dart:933:7)
List<bool> _checkboxSeleted;
void initState() {
super.initState();
...
setState(() {
_checkboxSeleted = [false, false, false];
_checkboxSeleted.addAll((widget._dataObj['key']));
});
}
add .cast<bool>()
List<bool> _checkboxSeleted;
void initState() {
super.initState();
...
setState(() {
_checkboxSeleted = [false, false, false];
_checkboxSeleted.addAll((widget._dataObj['key'].cast<bool>()));
});
}
all possible solution added Here [Solved] type ‘List‘ is not a subtype of type ‘List‘ in Flutter
E/flutter ( 4425): [ERROR:flutter/lib/ui/ui_dart_state.cc(166)] Unhandled Exception: type 'List' is not a subtype of type 'FutureOr?' of 'value'