【发布时间】:2021-06-07 05:50:40
【问题描述】:
我希望在我的 flutter-firestore 应用程序的页面中自动从列表视图中删除超过 10 天的项目。这是我创建该列表视图的代码。
body: StreamBuilder(
stream: FirebaseFirestore.instance
.collection('notifs')
.orderBy('notifTimestamp', descending: true)
.snapshots(),
builder:
(BuildContext context, AsyncSnapshot<QuerySnapshot> snapshot) {
if (!snapshot.hasData) {
return Text('Loading...');
}
return ListView.builder(
itemCount: snapshot.data.docs.length,
itemBuilder: (_, index) {
return Card(
child: Column(
children: [
...
]))}
如何自动删除超过 10 年的列表项?
【问题讨论】:
标签: flutter listview google-cloud-firestore