isValidJson property
bool
get
isValidJson
检查是否为有效的JSON格式
Implementation
bool get isValidJson {
try {
jsonDecode(this);
return true;
} catch (e) {
return false;
}
}
检查是否为有效的JSON格式
bool get isValidJson {
try {
jsonDecode(this);
return true;
} catch (e) {
return false;
}
}