hasGrantedAnyScopes method

bool hasGrantedAnyScopes(
  1. TokenResponse tokenResponse,
  2. List<String> scopes
)

Checks if hte user has granted all the specified scopes.

scopes is a space-separated list of scope names.

Method: google.accounts.oauth2.hasGrantedAllScopes https://developers.google.com/identity/oauth2/web/reference/js-reference#google.accounts.oauth2.hasGrantedAllScopes

Implementation

bool hasGrantedAnyScopes(TokenResponse tokenResponse, List<String> scopes) {
  return scopes
      .any((String scope) => _hasGrantedScope(tokenResponse, scope.toJS));
}