convertUserFromJson static method

Threat convertUserFromJson(
  1. String json
)

Implementation

static Threat convertUserFromJson(String json) {
  try {
    var jsonData = jsonDecode(json);
    return Threat.fromJson(jsonData);
  } on FormatException {
    throw CustomFormatException(
        message:
            '\n that is the wrong format for Threat \n $json\n right String format [{"threatId":"value","name":"value"}] \n Note: threatId is optional');
  }
}