fromJson method Null safety

Throwable? fromJson(
  1. dynamic jsonObject
)

Implementation

static Throwable? fromJson(jsonObject) {
  if (jsonObject == null) return null;
  var result = new Throwable();

  result.localizedMessage = jsonObject["localizedMessage"];
  result.message = jsonObject["message"];
  result.string = jsonObject["string"];
  if (jsonObject["stackTrace"] != null)
    for (var item in jsonObject["stackTrace"])
      result.stackTrace.add(StackTraceElement.fromJson(item));

  return result;
}