RestAPI class

Constructors

RestAPI.new()

Properties

apiKey String?
API key to be used on requests
getter/setter pair
authorizationHeader String?
no setter
baseUrl String
Base api url
getter/setter pair
cancelTokenCallback CancelTokenCallback?
Cancel token for cancelling requests
getter/setter pair
connectTimeout Duration?
Timeout for requests.
getter/setter pair
dio ↔ Dio
Underlying Dio client used by all new APIs.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
headers Map<String, dynamic>?
Custom HTTP headers to add on every request. Useful for proxies, tracing, etc.
getter/setter pair
httpClientAdapter ↔ HttpClientAdapter?
Set this adapter if you need control over http requests
getter/setter pair
interceptors List<Interceptor>?
Additional Dio interceptors appended after auth/header interceptor. Enables advanced customization like logging, retries, rate-limiting.
getter/setter pair
receiveTimeout Duration?
Timeout for receiving data.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sendTimeout Duration?
Timeout for sending data, like when using stream upload or Tus protocol.
getter/setter pair
tokenCallback TokenCallback?
Callback to asynchronously get API Authorization Bearer token
getter/setter pair

Methods

dispose() → void
init({String? apiKey, String? baseUrl, Duration? connectTimeout, Duration? receiveTimeout, Duration? sendTimeout, HttpClientAdapter? httpClientAdapter, Map<String, dynamic>? headers, TokenCallback? tokenCallback, CancelTokenCallback? cancelTokenCallback, List<Interceptor>? interceptors}) → void
Initialize the Dio client and register interceptors.
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

Constants

authorizationHeaderKey → const String
googleApiKeyKey → const String