Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

read firebase data from flutter

FirebaseFirestore.instance
    .collection('users')
    .doc(userId)
    .get()
    .then((DocumentSnapshot documentSnapshot) {
      if (documentSnapshot.exists) {
        print('Document exists on the database');
        Map<String, dynamic> data = 
        	documentSnapshot.data() as Map<String, dynamic>;

      }
});
Source by firebase.flutter.dev #
 
PREVIOUS NEXT
Tagged: #read #firebase #data #flutter
ADD COMMENT
Topic
Name
7+8 =