We are trying to fetch the data from cloud Firestore but we unable to find that how admin fetch all the information about user like their appointment
0
votes
please specify your issue description.
- Kandy
Have you tried with where ? yourCollection .where('username', isEqualTo: 'neha')
- Shyju M
yes, but we are feteching the user data but in admin dashboard we are retrieve only user login details not appointment details of users
- Neha Bhardwaj
thanks for giving the code but this code is already done for fetching the user data
- Neha Bhardwaj
1 Answers
1
votes
Hope you are using the plugin cloud_firestore to fetch the data from the firestore
initialize the firestore with your credentials which can be copied from your google_services.json file
final FirebaseApp app = await FirebaseApp.configure(
name: 'test',
options: const FirebaseOptions(
googleAppID: '1:79601577497:ios:5f2bcc6ba8cecddd',
gcmSenderID: '79601577497',
apiKey: 'AIzaSyArgmRGfB5kiQT6CunAOmKRVKEsxKmy6YI-G72PVU',
projectID: 'flutter-firestore',
),
);
final Firestore firestore = Firestore(app: app);
to fetch your documents
CollectionReference get users=> firestore.collection('users');
await users.where('name', isEqualTo: 'neha').getDocuments();
or
Firestore.instance.collection('users').where('name', isEqualTo: 'neha')
.snapshots.listen(
(data) => print('grower ${data.documents[0]['name']}')
);

