RestApiClientOptions class
Use this class to provide configuration for your RestApiClient instance
Constructors
-
RestApiClientOptions({String baseUrl = '', bool keepRetryingOnNetworkError = true, bool overrideBadCertificate = true, String refreshTokenEndpoint = '', String refreshTokenParameterName = '', String resolveJwt(dynamic response)?, String resolveRefreshToken(dynamic response)?, Map<
String, List< resolveValidationErrorsMap(dynamic response)?})String> >
Properties
- baseUrl → String
-
Defines your base API url eg. https://mybestrestapi.com
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- keepRetryingOnNetworkError → bool
-
Sets the flag deciding if the instance of restApiClient should retry to
submit the request after the device reconnects to the network
final
- overrideBadCertificate → bool
-
Sets the flag deciding if the instance of restApiClient should ignore ssl
certificate if it couldn't be decoded
final
- refreshTokenEndpoint → String
-
Define refresh token endpoint for RestApiClient
instance to use the first time response status code is 401
final
- refreshTokenParameterName → String
-
Define the name of your api parameter name
on RefreshToken endpoint eg. 'refreshToken' or 'value' ...
final
- resolveJwt → String Function(dynamic response)?
-
This method is called on successfull call to refreshTokenEndpoint
Provides a way to get a jwt from response, much like
resolveValidationErrorsMap callback
final
- resolveRefreshToken → String Function(dynamic response)?
-
Much like resolveJwt, this method is used to resolve
refresh token from response
final
-
resolveValidationErrorsMap
→ Map<
String, List< Function(dynamic response)?String> > -
If your api returns validation errors different from
default format that is response.data
'validationErrors'
you can override it by providing this callbackfinal - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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