isJson property

bool get isJson

Check if the string is valid JSON

Implementation

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