the recommended way is to use FlutterFire
and a simple example for fetching data would be:
FirebaseFirestore.instance
.collection('products')
.get()
.then((QuerySnapshot querySnapshot) => {
querySnapshot.docs.forEach((doc) {
print(doc["name"]);
});
});
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…