isJson property

bool isJson
'{}'.isJson; // true

Implementation

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