I would like to acces my firestore databse, by using the UID of each user, like so:
return new StreamBuilder(
stream: Firestore.instance.collection('users').document(uid).snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return new Text("Loading");
}
var userDocument = snapshot.data;
And for getting the UID:
final FirebaseUser user = auth.currentUser().then((FirebaseUser user) {
final userid = user.uid;
});
This but I keep getting the error
Undefined name 'auth'.
authvariable?