createCredential method

Credential createCredential({
  1. String? accessToken,
  2. String? tokenType,
  3. String? refreshToken,
  4. Duration? expiresIn,
  5. DateTime? expiresAt,
  6. String? idToken,
})

Creates a Credential for this client.

Implementation

Credential createCredential(
        {String? accessToken,
        String? tokenType,
        String? refreshToken,
        Duration? expiresIn,
        DateTime? expiresAt,
        String? idToken}) =>
    Credential._(
        this,
        TokenResponse.fromJson({
          'access_token': accessToken,
          'token_type': tokenType,
          'refresh_token': refreshToken,
          'id_token': idToken,
          if (expiresIn != null) 'expires_in': expiresIn.inSeconds,
          if (expiresAt != null)
            'expires_at': expiresAt.millisecondsSinceEpoch ~/ 1000
        }),
        null);