Skip to main content

smf_google_sign_in 0.6.0 copy "smf_google_sign_in: ^0.6.0" to clipboard
smf_google_sign_in: ^0.6.0 copied to clipboard

The SMF module of Google sign-in for the Flutter app that SMF generates. The users of the app sign in with their Google account on Android and iOS.

example/README.md

Generate a Flutter app that signs in with Google #

google_sign_in is the module of the SMF CLI with which the users of the app sign in with their Google account on Android and iOS. Choose it with -m, next to a provider of sign-in:

dart pub global activate smf_flutter_cli
smf create my_app -m firebase_auth,google_sign_in,apple_sign_in,sign_in,bloc

The module adds google_sign_in to the pubspec.yaml of the app, with the logo of Google among its assets, and lib/core/google_sign_in/google_sign_in.dart with googleCredential(), which asks Google for a credential, and GoogleSignInIcon, the icon of its button. The auth role lists the way to sign in in appSignInMethods of lib/core/auth/sign_in_methods.dart:

const List<SignInMethod> appSignInMethods = [
  SignInMethod(
    label: _googleSignInLabel,
    icon: method0.GoogleSignInIcon(),
    platforms: {TargetPlatform.android, TargetPlatform.iOS},
    credential: method0.googleCredential,
    issuer: 'https://accounts.google.com',
  ),
];

A screen of sign-in shows a button for each way to sign in that isAvailable on the platform of the app. On a tap, its state asks for a credential and gives it to the session of the app:

final credential = await method.credential();
if (credential == null) return; // The user closed the sheet of Google.
await appSession.signInWith(credential);

An anonymous user who signs in with Google keeps the id. Google sign-in needs the Google project to know the app, and the README of the app tells what that takes and what the provider of sign-in sets up of it.

The documentation has more on the google_sign_in module.

0
likes
160
points
--
downloads

Documentation

Documentation
API reference

Publisher

verified publishersaymyframe.com

Weekly Downloads

The SMF module of Google sign-in for the Flutter app that SMF generates. The users of the app sign in with their Google account on Android and iOS.

Homepage
Repository (GitHub)
View/report issues
Contributing

Topics

#flutter #google #authentication #sign-in

License

Apache-2.0 (license)

Dependencies

mason, smf_contracts

More

Packages that depend on smf_google_sign_in