toJson method

Map<String, dynamic> toJson()

A JSON map representation of this token suitable for SecureStorage persistence.

The map mirrors the OAuth2 response shape expected by tryFromJson. Expiration values are stored in whatever form they currently hold — absolute millisecond timestamps if tryFromJson was called with convert: true, or raw seconds otherwise.

Implementation

Map<String, dynamic> toJson() => <String, dynamic>{
  "token_type": tokenType,
  "expires_in": expiresIn,
  "refresh_expires_in": refreshExpiresIn,
  "access_token": accessToken,
  "refresh_token": refreshToken,
};