isJson function
check if the string is valid JSON
Implementation
bool isJson(str) {
try {
json.decode(str);
} catch (e) {
return false;
}
return true;
}
check if the string is valid JSON
bool isJson(str) {
try {
json.decode(str);
} catch (e) {
return false;
}
return true;
}