Tokens class

The pair every sign-in path returns: a short-lived access token, and the refresh token that renews it.

Parsed by hand rather than by json_serializable. The generated json['token'] as String raised a bare TypeError from inside the SDK on any response missing the field, which is the one defect class 1.0.0 set out to remove everywhere - see requireString.

Constructors

Tokens({required String token, String? refreshToken})
Tokens.fromJson(Map<String, dynamic> json, {String what = 'A token response'})
what names the endpoint in any failure, so a malformed body points at the response that carried it rather than at this line.
factory

Properties

hashCode → int
The hash code for this object.
no setterinherited
refreshToken ↔ String?
Absent on a response that has not finished authenticating: a sign-in awaiting a two factor code carries an access token and no refresh token.
getter/setter pair
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
token ↔ String
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited