parseBool static method
Implementation
static bool? parseBool(dynamic value, [bool? defaultValue]) {
if (value is bool) {
return value;
} else if (value is String) {
return value == '1' || value == 'true';
} else if (defaultValue != null) {
return defaultValue;
} else {
throw Exception('Not a boolean !');
}
}