fromJson method
- dynamic json
override
Implementation
@override
bool fromJson(dynamic json) {
if (json is int) {
return json == 1;
} else if (json is bool) {
return json;
} else {
throw ArgumentError.value(json, 'json', 'Expected an int or a bool');
}
}