I am currently working on Flutter Firebase to save the details of the users that are signing up for the app.
What I've done is that the user are able to sign up with their email and password. But what I would like to know is how do I add other user information such as Address to be saved so that the users will be able to see it when I am retrieving it from Firebase to the app.
What I've done :
AuthResult user = await
FirebaseAuth.instance.createUserWithEmailAndPassword(email: _email,password:_password);
This saves the user email and password into the database.
I've tried the solution on : Flutter user registration with Firebase: Add extra user information (age, username)
What I've tried to do :
Firestore.instance.collection('users').document().setData({ 'userid':
user.uid, 'username': _address });
And I seem to get errors on that Firestore is an undefined name along with the uid isn't defined for the class 'AuthResult' . Am I missing some import files?
I've only imported :
import 'package:firebase_auth/firebase_auth.dart';
Also, I know I have to create a table called user to allow the data to be saved in but which one do I use? The Cloud Firestore or the Realtime Database?
Thanks for all the help.