APIResponse<ModelType> class

Inheritance

Constructors

APIResponse(String body, int statusCode, {Map<String, String> headers = const {}, bool isRedirect = false, bool persistentConnection = true, String? reasonPhrase, BaseRequest? request, required ModelType fromMap(Map<String, dynamic> data)})
APIResponse.bytes(List<int> bodyBytes, int statusCode, {BaseRequest? request, Map<String, String> headers = const {}, bool isRedirect = false, bool persistentConnection = true, String? reasonPhrase, required ModelType fromMap(Map<String, dynamic> data)})
APIResponse.fromResponse(Response response, {required ModelType fromMap(Map<String, dynamic> data)})

Properties

body String
The body of the response as a string.
no setterinherited
bodyBytes Uint8List
The bytes comprising the body of this response.
finalinherited
contentLength int?
The size of the response body, in bytes.
finalinherited
description Description
no setter
firstOrNull → ModelType?
no setter
fromMap → ModelType Function(Map<String, dynamic> data)
final
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, String>
The HTTP headers returned by the server.
finalinherited
isRedirect bool
finalinherited
lastOrNull → ModelType?
no setter
mapRows List<Map<String, dynamic>>
no setter
persistentConnection bool
Whether the server requested that a persistent connection be maintained.
finalinherited
reasonPhrase String?
The reason phrase associated with the status code.
finalinherited
request → BaseRequest?
The (frozen) request that triggered this response.
finalinherited
rows List<ModelType>
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status APIResponseStatus
no setter
statusCode int
The HTTP status code for this response.
finalinherited

Methods

differenceOf(Set<ModelType> other) Set<ModelType>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited