Status.fromApiResponse constructor

Status.fromApiResponse(
  1. String responseBody
)

Constructs a Status from an API response

Implementation

factory Status.fromApiResponse(String responseBody) {
  try {
    return Status.fromJson(HttpHelper().jsonDecode(responseBody));
  } catch (e) {
    return Status(
      body: responseBody,
      status: 400,
      statusVerbose: _createStatusVerbose(responseBody, e),
    );
  }
}