getAuthenticatedClient method

  1. @override
Future<Client?> getAuthenticatedClient()
override

Returns the authenticated http client. It should be called after the user has signed in.

Implementation

@override
Future<http.Client?> getAuthenticatedClient() async {
  final credentials = _credentials;
  if (credentials == null) return null;

  final creds = <String, dynamic>{
    _kAccessTokenCredsKey: credentials.accessToken,
    _kScopeCredsKey:
        (credentials.scopes.isEmpty ? params.scopes : credentials.scopes)
            .join(_kScopesSeparator),
    _kRefreshTokenCredsKey: credentials.refreshToken,
    _kTokenTypeCredsKey: credentials.tokenType,
  };

  return __getAuthenticatedClient(creds);
}