We want to get "Ad soyad" data from our app for spesific place how can we do that?
CodePudding user response:
Just get the document and access its property.
// I don't know which documents you want to query, here it gets ALL of them
final docs = await firebase.collection('Çalisanlar').get();
// Just the first one as an example
final doc = docs.first;
// Print its `Ad soyad` property... or just do whatever you want with it.
print(doc['Ad soyad']);
CodePudding user response:
To get all the documents data:
void foo() async {
final col = FirebaseFirestore.instance.collection('Calisanlar');
final snapshot = await col.get();
for (var qSnapshot in snapshot.docs) {
final output = qSnapshot.get('Ad soyad');
}
}
To get a single document data:
void bar() async {
final doc = FirebaseFirestore.instance.collection('Calisanlar').doc('1xt...5n2');
final snapshot = await doc.get();
final output = snapshot.get('Ad soyad');
}