tryParseBool static method
解析bool,失败返回null
Implementation
static bool? tryParseBool(dynamic v) {
if (v is bool) {
return v;
} else if (v is String) {
return v == 'true';
}
return null;
}
解析bool,失败返回null
static bool? tryParseBool(dynamic v) {
if (v is bool) {
return v;
} else if (v is String) {
return v == 'true';
}
return null;
}