【发布时间】:2020-04-20 03:25:54
【问题描述】:
我目前正在为我的应用程序使用实时数据库。我无法从快照中读取特定用户数据。
我的代码:
final databaseReference = FirebaseDatabase.instance.reference();
void getData() {
databaseReference.once().then((DataSnapshot snapshot) {
Map<dynamic, dynamic> values = snapshot.value;
//print(snapshot.value['name']);
print('Data : ${snapshot.value}');
});
}
我的数据库布局:
Users:
userId:
name: TEST
email: TESTEmail@gmail.com
bio: TESTBio
我希望能够读取具有特定 userId 的个人的姓名(例如 Bdhsaiweuy2731319238121shda),我该怎么做?谢谢你的时间,我真的很感激。
【问题讨论】:
标签: firebase flutter firebase-realtime-database dart