Skip to content

Commit 5f6eec8

Browse files
davidairandreidiaconu
authored andcommitted
Updating the example to match the new API (flutter#1155)
1 parent 6f85a74 commit 5f6eec8

3 files changed

Lines changed: 11 additions & 4 deletions

File tree

packages/firebase_auth/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 0.8.0+2
2+
3+
* Update Google sign-in example in the README.
4+
15
## 0.8.0+1
26

37
* Update a broken dependency.

packages/firebase_auth/README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,15 @@ final FirebaseAuth _auth = FirebaseAuth.instance;
6161
You can now use the Firebase `_auth` to authenticate in your Dart code, e.g.
6262
```dart
6363
Future<FirebaseUser> _handleSignIn() async {
64-
GoogleSignInAccount googleUser = await _googleSignIn.signIn();
65-
GoogleSignInAuthentication googleAuth = await googleUser.authentication;
66-
FirebaseUser user = await _auth.signInWithGoogle(
64+
final GoogleSignInAccount googleUser = await _googleSignIn.signIn();
65+
final GoogleSignInAuthentication googleAuth = await googleUser.authentication;
66+
67+
final AuthCredential credential = GoogleAuthProvider.getCredential(
6768
accessToken: googleAuth.accessToken,
6869
idToken: googleAuth.idToken,
6970
);
71+
72+
final FirebaseUser user = await _auth.signInWithCredential(credential);
7073
print("signed in " + user.displayName);
7174
return user;
7275
}

packages/firebase_auth/pubspec.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Flutter plugin for Firebase Auth, enabling Android and iOS
44
like Google, Facebook and Twitter.
55
author: Flutter Team <[email protected]>
66
homepage: https://github.com/flutter/plugins/tree/master/packages/firebase_auth
7-
version: "0.8.0+1"
7+
version: "0.8.0+2"
88

99
flutter:
1010
plugin:

0 commit comments

Comments
 (0)