flutter - 如何从 firestore 中的 Stream 中的 snapshot.docs 中改组列表的顺序
问题描述
这是我从 Firestore 检索用户数据的代码:
StreamBuilder(
stream: FirebaseFirestore.instance.collection('Consultant').snapshots(),
builder: (context, snapshot) {
if (!snapshot.hasData)
return Center(child: CircularProgressIndicator());
return ListView.builder(
padding: EdgeInsets.fromLTRB(5, 5, 5, 60),
itemCount: snapshot.data.docs.length,
itemBuilder: (BuildContext context, int index) {
有可能随机化列表的顺序吗?
解决方案
推荐阅读
- c# - 使用 Serilog 接收器将自定义列写入 MS SQL Server
- python - 当我在 shell 窗口中出现错误时,是否有创建弹出消息的方法?
- c++ - 提升 mpi 非阻塞 + 层次聚集
- ios - 自定义 UIView 子类中的 UIButton 不触发动作事件
- c# - 在Unity中达到条件时显示和隐藏游戏对象?
- jquery - 使用 ReactJs jQuery ajax 发布请求下载时 Excel 文件损坏
- java - Timestamp from the client or the server - What's the best practice?
- angular - 有没有办法根据传递给函数的参数来设置 this 变量
- ios - Moya任务中的可选参数
- javascript - 更改处理程序不更新添加对象中的值