📜  如何从firebase颤振中获取单条记录-无论代码示例

📅  最后修改于: 2022-03-11 14:56:50.506000             🧑  作者: Mango

代码示例1
var collection = FirebaseFirestore.instance.collection('users');
var docSnapshot = await collection.doc('doc_id').get();
if (docSnapshot.exists) {
  Map? data = docSnapshot.data();
  var value = data?['some_field']; // <-- The value you want to retrieve. 
  // Call setState if needed.
}