This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| method 1 . | |
| this.afs.doc('collectionName/documentId').ref.get().then((documentSnapshot) => { | |
| console.log(documentSnapshot.exists); | |
| }); | |
| method 2 | |
| this.afs.firestore.doc('collectionName/documentId').get().then((documentSnapshot) => { | |
| console.log(documentSnapshot.exists); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // / /... .. . // | |
| final FirebaseAuth _auth = FirebaseAuth.instance; | |
| Future<String> signInWithGoogle() async { | |
| try{ | |
| final GoogleSignIn _googleSignIn = new GoogleSignIn(); | |
| GoogleSignInAccount googleUser = await _googleSignIn.signIn(); | |
| GoogleSignInAuthentication googleAuth = await googleUser.authentication; | |
| final AuthCredential credential = GoogleAuthProvider.getCredential( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class MyApp extends StatelessWidget { | |
| @override | |
| Widget build(BuildContext context) { | |
| return MaterialApp( | |
| initialRoute: '/login', | |
| onGenerateRoute: generateRoute, | |
| title: 'Test App', | |
| ); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Author: MB | |
| **/ | |
| import 'package:flutter/material.dart'; | |
| class MyClass extends StatefulWidget { | |
| @override | |
| _MyClassState createState() => _MyClassState(); | |
| } |
NewerOlder