fromString method Null safety

JSONObject? fromString(
  1. String jsonString
)

Implementation

static JSONObject? fromString(String jsonString) {
  try {
    return JSON.fromMap(json.decode(jsonString));
  } catch (Exception) {
    return null;
  }
}