Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lamnhan066/google_sign_in_helper
https://github.com/lamnhan066/google_sign_in_helper
Last synced: 7 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/lamnhan066/google_sign_in_helper
- Owner: lamnhan066
- License: mit
- Created: 2022-10-26T15:32:31.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2024-08-03T02:50:55.000Z (3 months ago)
- Last Synced: 2024-08-03T04:05:50.050Z (3 months ago)
- Language: Dart
- Size: 48.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
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;
```