initializeGoogleSignIn method
Future<void>
initializeGoogleSignIn(
)
Implementation
Future<void> initializeGoogleSignIn() async {
if (appConfigurationState.googleClientId == null) {
return;
}
final GoogleSignInPlatform platform = GoogleSignInPlatform.instance;
await platform.init(
InitParameters(
clientId: appConfigurationState.googleClientId,
serverClientId: kIsWeb ? null : appConfigurationState.googleClientId,
),
);
platform.authenticationEvents
?.listen((AuthenticationEvent authEvent) async {
switch (authEvent) {
case AuthenticationEventSignIn():
await signInWithGoogle(authEvent.authenticationTokens.idToken!);
case AuthenticationEventSignOut():
case AuthenticationEventException():
}
});
}