Response<D> class

This class contains the response details of a request This includes the status of the response The data or the parsed body of the response The error if the request failed or the parsing failed and hasError which is true if the error is not null and isCancelled which is true if the request was cancelled by the user. If the request gets cancelled by the user, the data and error will be null, and the status will be -1.

Constructors

Response({required int status, D? data, Object? error, bool isCancelled = false})

Properties

data → D?
final
error Object?
final
hasError bool
final
hashCode int
The hash code for this object.
no setterinherited
isCancelled bool
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
status int
final

Methods

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