isJSON method

bool isJSON(
  1. dynamic str
)

Implementation

bool isJSON(dynamic str) {
  try {
    jsonDecode(str.toString());
  } catch (e) {
    return false;
  }
  return true;
}