📌  相关文章
📜  访问带有 id 的单个文档 flutter - TypeScript 代码示例

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

代码示例1
Widget build(BuildContext context) {
  return new StreamBuilder(
      stream: Firestore.instance.collection('COLLECTION_NAME').document('TESTID1').snapshots(),
      builder: (context, snapshot) {
        if (!snapshot.hasData) {
          return new Text("Loading");
        }
        var userDocument = snapshot.data;
        return new Text(userDocument["name"]);
      }
  );
}