RequestData class

wraps all the data required for an api request for simpler reuse this gets stored if a request fails (in offline mode) it is therefor offline only and retried when the app is online

Annotations

Constructors

RequestData.new(String route, {Map<String, dynamic>? json, List<String>? multipartFileNames = const [], Duration? timeout, bool returnsBinary = false, bool? logIfFailed})
RequestData.fromFiles(String route, {Map<String, dynamic>? json, List<XFile>? multipartFiles, Duration? timeout, bool returnsBinary = false, bool? logIfFailed})

Properties

hashCode int
The hash code for this object.
no setterinherited
json Map<String, dynamic>?
the json data to send
getter/setter pair
logIfFailed bool?
if the request should log if it failed, null to fallback to default behaviour (log everything that doesnt simulate a Get-Request)
getter/setter pair
multipartFileNames List<String>?
the files to send
getter/setter pair
multipartFiles List<Future<XFile>>
no setter
returnsBinary bool
if the request should return binary data
getter/setter pair
route String
the route to the api
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serialized Future<Map<String, dynamic>>
only gets called when the request failed and has to be tried again later
no setter
timeout Duration?
the timeout for the request
getter/setter pair

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

Static Methods

deserialize(Map<String, dynamic> json) RequestData