1000字范文,内容丰富有趣,学习的好帮手!
1000字范文 > Bruno组件使用对比

Bruno组件使用对比

时间:2021-07-03 17:23:47

相关推荐

Bruno组件使用对比

修改前代码

// GridView.builder(//physics: new NeverScrollableScrollPhysics(),//shrinkWrap: true,//gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(// //横轴元素个数// crossAxisCount: 5,// //纵轴间距// mainAxisSpacing: 7.0,// //横轴间距// crossAxisSpacing: 7.0,// //子组件宽高长度比例// childAspectRatio: 2.1/1), itemCount:_model!.data![0].attributeLineIds![index].valueIds!.length,//itemBuilder: (BuildContext context, int a){// return GestureDetector(// onTap: (){// _model!.data![0].attributeLineIds![index].indexSelection = a;//// setState(() {//// });// },// child: Container(// decoration: BoxDecoration(// border: Border.all(color:_model!.data![0].attributeLineIds![index].indexSelection==a?Colors.deepOrange:Colors.transparent),// color: _model!.data![0].attributeLineIds![index].indexSelection==a?Colors.deepOrange.shade100:Colors.grey[200],// borderRadius: BorderRadius.circular(20.0),// ),// padding: EdgeInsets.all(5),// alignment: Alignment.center,// child: Text('${_model!.data![0].attributeLineIds![index].valueIds![a].name}',// style: TextStyle(fontSize: 12,color:_model!.data![0].attributeLineIds![index].indexSelection==a?Colors.deepOrange:Colors.black87),//// ),// ),// );//})

使用 Bruno 修改后代码

BrnSelectTag(initTagState: [true],tags: _model!.data![0].attributeLineIds![index].valueIds!.map((e) => e.name!).toList(),isSingleSelect: true,fixWidthMode: false,spacing: 12,onSelect: (selectedIndexes) {// BrnToast.show(selectedIndexes.toString(), context);_model!.data![0].attributeLineIds![index].indexSelection = selectedIndexes[0];setState(() {});}),

中亿丰—李宇坤

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。