ErrorResponse.fromJson constructor

ErrorResponse.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory ErrorResponse.fromJson(Map<String, dynamic> json) => ErrorResponse(
      status: json["status"],
      error: json["error"],
      message: json["message"],
      errors: json.containsKey("errors")
          ? List<Error>.from(json["errors"].map((x) => Error.fromJson(x)))
          : null,
      content: json.containsKey("content")
          ? json["content"].toString().contains("user_id") &&
                  json["content"].toString().contains("reset_password_hash")
              ? ImportedUserWithoutPasswordErrorResponseContent.fromJson(
                  json["content"],
                )
              : json["content"]
          : null,
      errorType: json["error_type"],
      path: json["path"],
    );