因此,我有一个名为“用户”的集合,并根据他们的身份验证uid创建了文档。我希望能够浏览所有用户文档,找到并显示所有“全名”,其中包含一个变量或字段,该变量或字段名为ANSYSLVL3>80
在弗利特我该怎么做?
编辑:
到目前为止,这就是我所拥有的
class amphLeaderboard extends StatefulWidget {
@override
_amphLeaderboardState createState() => _amphLeaderboardState();
}
class _amphLeaderboardState extends State<amphLeaderboard> {
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
title: Text(
'Amphibians 100% Completion',
style: GoogleFonts.sora(
textStyle: TextStyle(
/*fontWeight: FontWeight.bold,*/
fontSize: 18,
color: mywhite,
)),
),
automaticallyImplyLeading: false,
centerTitle: true,
elevation: 0,
),
body: Center(
child: FutureBuilder<QuerySnapshot>(
future: FirebaseFirestore.instance
.collection("users")
.where("amphibianslvl3", isGreaterThan: 80)
.get(),
builder: (context, snapshot) {
if (!snapshot.hasData) {
return CircularProgressIndicator();
}
return ListView(
children: snapshot.data.docs.map(
(e) {
return Text((e.data() as Map)["userName"], style: TextStyle(fontSize: 20, color: Colors.white),);
},
).toList(),
);
},
),
),
);
}
}
但它没有返回任何东西,屏幕只是黑色的