TokenSet class final Getting Started

A ready-made token value for apps that need no custom token type.

Pair it with TokenSetInfo so the manager knows when it expires.

final tokens = TokenSet(
  accessToken: 'access',
  refreshToken: 'refresh',
  expiresAt: DateTime.now().add(const Duration(hours: 1)),
);

Constructors

TokenSet({required String accessToken, String? refreshToken, DateTime? expiresAt})
Creates a token set.
const

Properties

accessToken → String
The access token.
final
expiresAt → DateTime?
When the access token expires, or null if it never does.
final
hashCode → int
The hash code for this object.
no setteroverride
refreshToken → String?
The refresh token, if the server issued one.
final
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.
override