GoogleSignInPlugin class
Implementation of the google_sign_in plugin for Web.
- Inheritance
-
- Object
- PlatformInterface
- GoogleSignInPlatform
- GoogleSignInPlugin
Constructors
-
GoogleSignInPlugin({@visibleForTesting bool debugOverrideLoader = false, @visibleForTesting GisSdkClient? debugOverrideGisSdkClient, @visibleForTesting StreamController<
GoogleSignInUserData?> ? debugOverrideUserDataController}) - Constructs the plugin immediately and begins initializing it in the background.
Properties
- autoDetectedClientId ↔ String?
-
Stores the client ID if it was set in a meta-tag of the page.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
-
initialized
→ Future<
void> -
A future that resolves when the plugin is fully initialized.
no setter
- isMock → bool
-
Only mock implementations should set this to
true
.no setterinherited - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
userDataEvents
→ Stream<
GoogleSignInUserData?> ? -
Returns a stream of
GoogleSignInUserData
authentication events.no setteroverride
Methods
-
canAccessScopes(
List< String> scopes, {String? accessToken}) → Future<bool> -
Checks if the current user has granted access to all the specified
scopes
.override -
clearAuthCache(
{required String token}) → Future< void> -
Clears any cached information that the plugin may be holding on to.
override
-
disconnect(
) → Future< void> -
Revokes all of the scopes that the user granted.
override
-
getTokens(
{required String email, bool? shouldRecoverAuth}) → Future< GoogleSignInTokenData> -
Returns the Tokens used to authenticate other API calls.
override
-
init(
{List< String> scopes = const <String>[], SignInOption signInOption = SignInOption.standard, String? hostedDomain, String? clientId}) → Future<void> -
Initializes the plugin. Deprecated: call initWithParams instead.
override
-
initWithParams(
SignInInitParameters params) → Future< void> -
Initializes the plugin with specified
params
. You must call this method before calling other methods.override -
isSignedIn(
) → Future< bool> -
Returns whether the current user is currently signed in.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
renderButton(
{GSIButtonConfiguration? configuration}) → Widget - Render the GSI button web experience.
-
requestScopes(
List< String> scopes) → Future<bool> -
Requests the user grants additional Oauth
scopes
.override -
requestServerAuthCode(
) → Future< String?> - Requests server auth code from GIS Client per: https://developers.google.com/identity/oauth2/web/guides/use-code-model#initialize_a_code_client
-
signIn(
) → Future< GoogleSignInUserData?> -
Signs in the user with the options specified to init.
override
-
signInSilently(
) → Future< GoogleSignInUserData?> -
Attempts to reuse pre-existing credentials to sign in again, without user interaction.
override
-
signOut(
) → Future< void> -
Signs out the current account from the application.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
registerWith(
Registrar registrar) → void -
Factory method that initializes the plugin with
GoogleSignInPlatform
.