GoogleSignIn class

GoogleSignIn allows you to authenticate Google users.

Constructors

GoogleSignIn({SignInOption signInOption, List<String> scopes, String hostedDomain })
Initializes global sign-in configuration settings. [...]
GoogleSignIn.games()
Factory for creating sign in suitable for games. This option must not be used on iOS because the games API is not supported.
factory
GoogleSignIn.standard({List<String> scopes, String hostedDomain })
Factory for creating default sign in user experience.
factory

Properties

currentUser GoogleSignInAccount
The currently signed in account, or null if the user is signed out.
read-only
hostedDomain → String
Domain to restrict sign-in to.
final
onCurrentUserChanged → Stream<GoogleSignInAccount>
Subscribe to this stream to be notified when the current user changes.
read-only
scopes → List<String>
The list of scopes are OAuth scope codes requested when signing in.
final
signInOption SignInOption
Option to determine the sign in user experience. SignInOption.games must not be used on iOS.
final
hashCode → int
The hash code for this object.
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

disconnect() → Future<GoogleSignInAccount>
Disconnects the current user from the app and revokes previous authentication.
isSignedIn() → Future<bool>
Returns a future that resolves to whether a user is currently signed in.
signIn() → Future<GoogleSignInAccount>
Starts the interactive sign-in process. [...]
signInSilently({bool suppressErrors: true }) → Future<GoogleSignInAccount>
Attempts to sign in a previously authenticated user without interaction. [...]
signOut() → Future<GoogleSignInAccount>
Marks current user as being in the signed out state.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() → String
Returns a string representation of this object.
inherited

Operators

operator ==(dynamic other) → bool
The equality operator.
inherited

Constants

channel → const MethodChannel
The MethodChannel over which this class communicates.
@visibleForTesting
const MethodChannel('plugins.flutter.io/google_sign_in')
kSignInCanceledError → const String
Error code indicating that interactive sign in process was canceled by the user.
'sign_in_canceled'
kSignInFailedError → const String
Error code indicating that attempt to sign in failed.
'sign_in_failed'
kSignInRequiredError → const String
Error code indicating there is no signed in user and interactive sign in flow is required.
'sign_in_required'