RequestMapper<R, T> class
Model for a RequestMapper.
T is the return type, the type your response is parsed to.
R is the response type. If you're using Dio, it is Response.
The order in which a gateway checks mappers is mapResponse -> mapData -> mapJson. The first appropriate mapper is then used to map the response.
Constructors
-
RequestMapper({T mapJson(Map<
String, dynamic> json)?, T mapData(dynamic data)?, T mapResponse(R resp)?, T onError(Object e)?}) -
const
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- mapData → T Function(dynamic data)?
-
final
-
mapJson
→ T Function(Map<
String, dynamic> json)? -
final
- mapResponse → T Function(R resp)?
-
final
- onError → T Function(Object e)?
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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