I create app with flutter using firebase. when i create authentication then it shows so much error in User class .I posted the Code. Please resolve my issue.
Apache License 2.0
0
stars
0
forks
source link
Error during authentication . Errors are commenting in line #1
import 'package:firebase_auth/firebase_auth.dart'; import 'package:flutter/cupertino.dart'; import 'package:google_sign_in/google_sign_in.dart';
class Authentication with ChangeNotifier { final FirebaseAuth firebaseAuth = FirebaseAuth.instance; final GoogleSignIn googleSignIn = GoogleSignIn();
String userUid; // error shows redline in userUid String get getUserUid => userUid;
Future<User?> logIntoAccount(String email, String password) async { UserCredential userCredential = await firebaseAuth .signInWithEmailAndPassword(email: email, password: password);
}
Future createAccount(String email, String password) async { UserCredential userCredential = await firebaseAuth .createUserWithEmailAndPassword(email: email, password: password);
}
Future logOutViaEmail() async { return firebaseAuth.signOut(); }
Future signInWithGoogle() async { final GoogleSignInAccount googleSignInAccount = await googleSignIn.signIn(); // error showing on googleSignIn.signIn(); final GoogleSignInAuthentication googleSignInAuthentication = await googleSignInAccount.authentication;
}
Future signOutWithGoogle() async { return googleSignIn.signOut(); } }