FlutterSecureTokenManager class
A singleton manager to securely handle access and refresh tokens.
Provides storage, retrieval, validation, and automatic refresh handling for tokens in Flutter applications.
Constructors
- FlutterSecureTokenManager()
-
Returns the singleton instance of FlutterSecureTokenManager.
factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isTokenExpired
↔ Future<
bool> Function(String? accessToken) -
Callback to check whether an access token is expired.
getter/setter pair
-
onTokenExpired
↔ Future<
Token> Function(String refreshToken)? -
Callback triggered when the access token has expired.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearToken(
) → Future< void> - Clears all stored tokens.
-
getAccessToken(
) → Future< String> - Retrieves a valid access token.
-
getRefreshToken(
) → Future< String?> - Retrieves the refresh token.
-
getToken(
) → Future< Token?> - Retrieves the saved Token.
-
hasToken(
) → Future< bool> - Checks whether both access and refresh tokens are stored.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
setToken(
{required Token token}) → Future< void> -
Saves the given
tokensecurely. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited