isJson method
Returns true
if the string can be parsed as a JSON object, false
otherwise.
Implementation
bool isJson() {
try {
jsonDecode(this);
return true;
} on FormatException catch (_) {
return false;
}
}
Returns true
if the string can be parsed as a JSON object, false
otherwise.
bool isJson() {
try {
jsonDecode(this);
return true;
} on FormatException catch (_) {
return false;
}
}