Session class abstract

Stores session data for the project, related to authentication and such.

Properties

hashCode int
The hash code for this object.
no setterinherited
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

Static Properties

doRefreshToken bool
Whether or not the refreshToken loop is running
no setter
refreshBefore Duration
The amount of time before a token expires that it will be refreshed
getter/setter pair
refreshesAt DateTime?
Stores the DateTime that this token is refreshed at
getter/setter pair
refreshToken String?
The refresh token from the token response, equivilant to tokenResponse.refreshToken!
getter/setter pair
token String?
The string representation of your token, equivilant to tokenResponse.accessToken!
getter/setter pair
tokenData Map<String, dynamic>
A map storing the information from your token, decoded using jaguar jwt
getter/setter pair
tokenResponse ↔ TokenResponse?
The response to an attempt to get an authentication token. Make sure to set before use
getter/setter pair

Static Methods

disableColors() → void
Disable the colors in the logs if your terminal does not support escape codes
onLogout() → void
Stops the token refresh loop and clears token data
onToken(TokenResponse response) bool
Call this when you get your token. Will return false if the token was null, true otherwise
startTokenLoop() → void
Starts the refresh token loop, will refresh refreshBefore before the token expires. You can stop with stopRefreshTokenLoop
stopRefreshTokenLoop() → void
Stops the token refresh loop