BaseApi class abstract
This class is a simple wrapper around http
library
it's main target is to handle auth headers.
Override this class in order to add your own request methods
- Implementers
Properties
-
defaultHeaders
→ Map<
String, String> -
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url → Uri
-
final
Methods
-
delete(
String endpoint, {Map< String, String> ? headers, Map<String, dynamic> ? queryParameters, dynamic body, Encoding? encoding, DateTime? createdAt, ObjectId? id, CacheKey? key, OnProgress? onProgress}) → Future<Response> - Send http delete request.
-
dispose(
) → void - Disposes all links.
-
forEachLink(
void callback(ApiLink)) → void -
get(
String endpoint, {Map< String, String> ? headers, Map<String, dynamic> ? queryParameters, Encoding? encoding, DateTime? createdAt, ObjectId? id, CacheKey? key, OnProgress? onProgress}) → Future<Response> - Send http get request.
-
getFirstLinkOfType<
T extends ApiLink?> () → T? -
Get first link of provided type from current link chain.
If ApiLink chain does not contain link of provided type,
null
will be returned. -
getFirstLinkWhere(
bool test(ApiLink? link)) → ApiLink? -
head(
String endpoint, {Map< String, String> ? headers, Map<String, dynamic> ? queryParameters, Encoding? encoding, DateTime? createdAt, ObjectId? id, CacheKey? key, OnProgress? onProgress}) → Future<Response> - Send http head request.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
patch(
String endpoint, {Map< String, String> ? headers, Map<String, dynamic> ? queryParameters, dynamic body, Encoding? encoding, DateTime? createdAt, ObjectId? id, CacheKey? key, OnProgress? onProgress}) → Future<Response> - Send http patch request.
-
post(
String endpoint, {Map< String, String> ? headers, Map<String, dynamic> ? queryParameters, dynamic body, Encoding? encoding, DateTime? createdAt, ObjectId? id, CacheKey? key, OnProgress? onProgress}) → Future<Response> - Send http post request.
-
put(
String endpoint, {Map< String, String> ? headers, Map<String, dynamic> ? queryParameters, dynamic body, Encoding? encoding, DateTime? createdAt, ObjectId? id, CacheKey? key, OnProgress? onProgress}) → Future<Response> - Send http put request.
-
send(
Request request) → Future< Response> -
Make API request by triggering ApiLinks
next
methods -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited