热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

如何对从CloudFirestore扑捉数据的列表的特定索引进行更改?

在flutter应用程序中,我从Firestore的列表中提取了数据,现在想使用ADD或REMOVE选项

在flutter应用程序中,我从Firestore的列表中提取了数据,现在想使用ADD或REMOVE选项来增加或减少列表中该特定项目的单位数量,但是经过几次尝试后却无法做到这一点因为整个列表中的计数会更新,而不是该索引中的特定元素。有人可以帮我吗

CustomScrollView(
physics: BouncingScrollPhysics(),slivers: [
SliverList(
delegate: SliverChildBuilderDelegate((context,index){
return Container(
margin: EdgeInsets.only(top: 15.0,left: 15.0,right: 15.0),child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,children: [
Container(
child: Text(snapshot.data.documents[index].documentID,style: TextStyle(fontFamily: "DelishN",fontSize: 15.0),),Container(
decoration: BoxDecoration(
border: Border.all(
width: 2.0,color: Colors.black
),borderRadius: BorderRadius.circular(23.0)
),child: Row(
children: [
FloatingactionButton(
onpressed: (){
add();
},mini: true,child: Icon(Icons.add,color: Colors.black,backgroundColor: Colors.white,SizedBox(
width: 7.0,Text(_n.toString(),style: TextStyle(fontFamily: 'DelishN',FloatingactionButton(
onpressed: (){
minus();
},child: Icon(Icons.remove,)
],)
],)
);
},childCount: snapshot.data.documents.length))],)





推荐阅读
author-avatar
大伙没事偷着乐吧
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有