signInSilently method

Future<GoogleSignInAccount?> signInSilently({
  1. bool suppressErrors = true,
})

Attempts to sign in a previously authenticated user without interaction.

Returned Future resolves to an instance of GoogleSignInAccount for a successful sign in or null if there is no previously authenticated user. Use signIn method to trigger interactive sign in process.

Authentication process is triggered only if there is no currently signed in user (that is when currentUser == null), otherwise this method returns a Future which resolves to the same user instance.

Re-authentication can be triggered only after signOut or disconnect.

When suppressErrors is set to false and an error occurred during sign in returned Future completes with PlatformException whose code can be either kSignInRequiredError (when there is no authenticated user) or kSignInFailedError (when an unknown error occurred).

Implementation

Future<GoogleSignInAccount?> signInSilently({bool suppressErrors = true}) {
  final Future<GoogleSignInAccount?> result =
      _addMethodCall('signInSilently');
  if (suppressErrors) {
    return result.catchError((dynamic _) => null);
  }
  return result;
}