flutter_firebase_auth_example icon indicating copy to clipboard operation
flutter_firebase_auth_example copied to clipboard

Showing Error

Open simeon105 opened this issue 6 years ago • 2 comments

Why is this line of code showing error : FirebaseUser user = await FirebaseAuth.instance .createUserWithEmailAndPassword(email: email, password: password);

???

simeon105 avatar Aug 12 '19 12:08 simeon105

I catch that as well, I think it should be: FirebaseAuth user = await FirebaseAuth.instance .createUserWithEmailAndPassword(email: email, password: password);

I'm also still analysing this repo. Please lemme know how it goes. Thanks!

leemuljadi avatar Sep 28 '19 12:09 leemuljadi

Replace the signUp function with the following:

static Future<String> signUp(String email, String password) async { final user = (await FirebaseAuth.instance .createUserWithEmailAndPassword(email: email, password: password)).user; return user.uid; }

The error is being made due to updates to firebase that changed the Type of .createUserWithEmailAndPassword from FirebaseUser to Type AuthResult

snwagbata avatar Oct 11 '19 18:10 snwagbata