且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

扑火基地如何获取节点的所有子节点

更新时间:2023-02-05 20:31:12

类似的操作应该可以获取用户列表:

Something like this should you get the list of users:

static Future<int> getUserAmount() async {
  final response = await FirebaseDatabase.instance
      .reference()
      .child("Users")
      .once();
  var users = [];
  reponse.value.forEach((v) => users.add(v));
  print(users);
  return users.length;
}

您可以与 users 一起检查您需要检查的内容,然后返回结果;

You can check with users what you need to check and then return a result;