xxxxxxxxxx
final FirebaseAuth _auth = FirebaseAuth.instance;
Future<void> _signOut() async {
await _auth.signOut();
}
xxxxxxxxxx
final FirebaseAuth auth = FirebaseAuth.instance;
void inputData() {
final User user = auth.currentUser;
final uid = user.uid;
// here you write the codes to input the data into firestore
}
xxxxxxxxxx
if(FirebaseAuth.instance.currentUser() != null){
// wrong call in wrong place!
Navigator.of(context).pushReplacement(MaterialPageRoute(
builder: (context) => HomeScreen()
));
}
xxxxxxxxxx
final FirebaseAuth _auth = FirebaseAuth.instance;
Future<void> _signOut() async {
await _auth.signOut();
await _googleSignIn.signOut();
}