ErrorResponse.fromJson constructor

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

Returns a ErrorResponse type from a JSON

Implementation

factory ErrorResponse.fromJson(Map<String, dynamic> data) {
  var self = ErrorResponse._();
  self._map["code"] =
      data['code'] ?? {throw ArgumentError('code should not be null')};
  self._map["message"] =
      data['message'] ?? {throw ArgumentError('message should not be null')};
  self._map["errors"] = data['errors'] == null
      ? null
      : data['errors'].map((map) => Map<String, dynamic>.from(map)).toList();
  return self;
}