TrayRequest<T > class
Methods
afterSuccess (TrayRequestResponse result )
→ void
this is a hook, that can be overwritten to perform actions, after the request has been done successfully
generateMetaData <RequestType extends TrayRequest , MetadataType extends TrayRequestMetadata > (RequestType request , dynamic responseJson )
→ dynamic
getBody ()
→ dynamic
returns the request body object
getEnvironment ()
→ TrayEnvironment
returns the fetch hook client used for this request
returns the combined headers from this request and client
getModelFromJson (dynamic json )
→ dynamic
a method, that takes a json input and returns the result method
for a single entry
getParams ([Map <String , String ? > requestParams = const {} ])
→ Future <Map <String , String > >
a method that allows us to customize even complex params generations
by default, we just return the params passed to the request here.
getParamsRaw ([Map <String , String ? > customParams = const {} ])
→ Map <String , String >
a method that allows us to customize even complex params generations
by default, we just return the params passed to the request here.
getUrl ()
→ Future <String >
a method that allows us to customize even complex url generations
by default, we just return the url passed to the request here.
getUrlWithParams ()
→ Future <String >
parses the params and makes sure they are either inserted into the
path (if used like /user/:var1/:var2/
) or if not defined there, they will
be added as query params
mergePaginatedResults (T currentData , T newData )
→ T
Defines the way paginated results should be combined
This method should be implemented in the request itself.
This is just a fallback, to throw an error if not implemented correctly.
noSuchMethod (Invocation invocation )
→ dynamic
Invoked when a nonexistent method or property is accessed.
inherited
A method to access the pagination provider defined for this request
The provider contains normalized pagination methods like fetchMore, ...
toString ()
→ String
A string representation of this object.
inherited