BaseRequest<T> class
abstract
Main class for http requests
- Implementers
Constructors
-
BaseRequest.new({RequestMethod method = RequestMethod.get, String? url, ResponseParser<
T> ? parser, Map<String, dynamic> ? query, Duration? timeout, Map<String, dynamic> ? headers, dynamic body, String? baseUrl, bool requiresLogin = true, DatabaseGetDelegate<T> ? databaseGetDelegate, DatabasePutDelegate<T> ? databasePutDelegate, SimulateResponse? simulateResponse, Response<T> ? simulateResult, Future<FormData> ? formData, bool ignoreCancelations = false, void onPrefetchFromDatabase(T?)?, Iterable<Interceptor> additionalInterceptors = const []})
Properties
-
additionalInterceptors
↔ Iterable<
Interceptor> -
Aditional interceptors for
Dio
instancegetter/setter pair - baseUrl ↔ String?
-
Base url for request
getter/setter pair
- body ↔ dynamic
-
Body for this request
getter/setter pair
-
databaseGetDelegate
↔ DatabaseGetDelegate<
T> ? -
Delegate to get data from local database
getter/setter pair
-
databasePutDelegate
↔ DatabasePutDelegate<
T> ? -
Delegate to put data to local database
getter/setter pair
- dioInstance → Dio?
-
Underlying
Dio
instanceno setter -
formData
↔ Future<
FormData> ? -
Form data for this request
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
headers
↔ Map<
String, dynamic> ? -
Headers for this request
getter/setter pair
- ignoreCancelations ↔ bool
-
Flag indicating that this request cant be canceled from RequestCollection
getter/setter pair
- method ↔ RequestMethod
-
Http request method
getter/setter pair
- onPrefetchFromDatabase ↔ void Function(T?)?
-
getter/setter pair
-
parser
↔ ResponseParser<
T> ? -
Parser function for this request
getter/setter pair
-
query
↔ Map<
String, dynamic> ? -
Query for this request - will be added to the end of the url
getter/setter pair
- requestCollection → RequestCollection
-
Collection of all running requests
no setter
- requiresLogin ↔ bool
-
Flag to indicate that we need to add autharization headers to this request
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- simulateResponse ↔ SimulateResponse?
-
For tests: simulates unparsed raw server response
getter/setter pair
-
simulateResult
↔ Response<
T> ? -
For tests: simulates parsed result for this request
getter/setter pair
- timeout ↔ Duration?
-
Summary timeout for connect and receive timeouts
getter/setter pair
- url ↔ String?
-
Url to be added to baseUrl - always starts with /
getter/setter pair
Methods
-
cancel(
) → void - Cancels current request if it is still executing
-
execute(
) → Future< Response< T> > - Executes this request and returns Response value
-
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