ApiRequestOptions class
Constructors
Properties
- baseUrl ↔ String
-
base url for your api
You can set it ApiRequestOptions.instance.baseUrl = 'https://example.com';
getter/setter pair
- connectTimeout ↔ int?
-
Timeout in milliseconds for opening url.
Dio
will throw theDioError
withDioErrorType.connectTimeout
type when time out.getter/setter pair -
defaultQueryParameters
↔ Map<
String, dynamic> -
getter/setter pair
- enableLog ↔ bool
-
to disable log set it to false
getter/setter pair
-
getAsyncToken
↔ GetAsyncOption<
String?> ? -
get access token use async callback function
getter/setter pair
-
getToken
↔ GetOption<
String?> ? -
get access token use callback function
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
interceptors
↔ List<
ApiInterceptor> -
list of global interceptors
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- token ↔ String?
-
access token
getter/setter pair
- tokenType ↔ String?
-
set tokenType for types
getter/setter pair
- unauthenticated ↔ GetOption?
-
write what you wont if your server response unauthenticated with status code 401
getter/setter pair
Methods
-
config(
{String? baseUrl, String? token, GetOption< String?> ? getToken, GetAsyncOption<String?> ? getAsyncToken, GetOption? unauthenticated, Map<String, dynamic> ? defaultQueryParameters, String? tokenType, int? connectTimeout, bool? enableLog, List<ApiInterceptor> ? interceptors}) → void -
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 Properties
- bearer ↔ String
-
for Bearer token type.
getter/setter pair
- instance → ApiRequestOptions?
-
Singleton for ApiRequestOptions by create one instance
no setter