Reputation: 1393
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
Upvotes: 0
Views: 2537
Reputation: 9943
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']}')
);
Upvotes: 1