AutoRefreshing mixin
Provides functionality for automatically refreshing _accessToken
after
Duration
obtained from _accessToken
using _tokenExpiration
method.
- Superclass Constraints
- Mixin Applications
Properties
- accessToken ↔ String
-
Token used for OAuth authentication.
getter/setter pairinherited
-
A value to be used as 'Authorization' header value.
no setterinherited
- client → Client
-
Underlying client used for making requests.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- refreshTimer → Timer
-
Timer that triggers token refresh.
no setter
- refreshToken ↔ String
-
A refreshToken used to obtain a new accessToken.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → void -
Cancels the refreshTimer and calls the super close method.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
refreshTokens(
) → Future< void> -
A refreshToken used to obtain a new accessToken.
inherited
-
send<
T> (Request< T> request) → Future<Response> -
Adds authorization header to the request headers.
inherited
-
serializeBody<
T> (T? body) → Object? -
Serializes
body
if it conforms to Serializable.inherited -
setTokens(
TokenPair tokens) → void -
Sets the accessToken and refreshToken to corresponding values from
tokens
.override -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited