isJson property
bool
isJson
'{}'.isJson; // true
Implementation
bool get isJson {
try {
json.decode(this);
return true;
} catch (e) {
return false;
}
}
'{}'.isJson; // true
bool get isJson {
try {
json.decode(this);
return true;
} catch (e) {
return false;
}
}