Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/lamnhan066/google_sign_in_helper


https://github.com/lamnhan066/google_sign_in_helper

Last synced: 7 days ago
JSON representation

Awesome Lists containing this project

README

        

# Google Sign In Helper

Make it easier for you to use google sign in on all platforms.

## Usage

**Configure the plguin:**

- Mobile: https://pub.dev/packages/google_sign_in
- Desktop: https://pub.dev/packages/google_sign_in_dartio

**Initialize the plugin:**

``` dart
final googleSignInHelper = GoogleSignInHelper(
currentPlatform: DefaultFirebaseOptions.currentPlatform,

// Add desktop id to this if you're using desktop
desktopId: null,
);
```

**Sign in:**

``` dart
bool result = await googleSignInHelper.signIn();
```

**Sign in silently:**

``` dart
bool result = await googleSignInHelper.signInSilently();
```

**Sign out:**

``` dart
await googleSignInHelper.signOut();
```

**Disconnect:**

``` dart
await googleSignInHelper.disconnect();
```

**Values that you can get after signed in:**

``` dart
/// Get [GoogleSignIn] instance
GoogleSignIn? googleSignInHelper.googleSignIn;

/// Get headers from the google sign in
Map googleSignInHelper.headers;

/// Get [GoogleSignInAuthentication] information
GoogleSignInAuthentication? googleSignInHelper.authInfo;

/// Get [GoogleUser] information
GoogleUser? googleSignInHelper.user;

/// Get [GoogleAuthClient]
GoogleAuthClient? googleSignInHelper.client;

/// Change when user sign in or sign out
Stream googleSignInHelper.onSignChanged;

/// Get current signed in state
bool googleSignInHelper.isSigned;
```