是否可以從 firebase firestore 獲取資料而不將其放入 Flutter 的串列/串列視圖中?如何?
uj5u.com熱心網友回復:
是的,您可以獲得資料
DocumentSnapshot documentSnapshot = FirebaseFirestore.instance.collection('collection').get()
Var data = documentSnapshot.data();
uj5u.com熱心網友回復:
是的,您可以這樣做以從 firebase 獲取資料。
FirebaseFirestore.instance.collection('users').doc(userId).get().then((DocumentSnapshot documentSnapshot) {
if (documentSnapshot.exists) {
print('Document data: ${documentSnapshot.data()}');
} else {
print('Document does not exist on the database');
}
});
uj5u.com熱心網友回復:
是的
FirebaseFirestore.instance.collection('users').get().then()
.then((value) {
//in value you have saved the data on it and you can use it whenever you want
});
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/459950.html
上一篇:如何實作自定義對話框?
