
int _selectPosition = -1;
List<ExpUserCellList> _latticeList = [];
Container(
alignment: Alignment.topCenter,
margin: EdgeInsets.only(top: 60.w),
child: Wrap(
crossAxisAlignment: WrapCrossAlignment.start,
alignment: WrapAlignment.start,
spacing: 20.w,
runSpacing: 20.w,
children: List.generate(_latticeList.length, (index) {
return GestureDetector(
child: Container(
alignment: Alignment.center,
width: Utils().screenWidth(context) * 0.22,
height: 68.w,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(5),
color: _selectPosition == index?Colors.white:JadeColors.grey_5,
border: Border.all(width: 1,color: _selectPosition == index?JadeColors.blue_2:JadeColors.grey_5)
),
child: Text('${_latticeList[index].num}${S.current.grid}',style: TextStyle(color: _selectPosition == index?JadeColors.blue_2 : _latticeList[index].cellPublishStatus == 0?JadeColors.grey_7:JadeColors.grey_2,fontSize: setFontSize(28),fontWeight: FontWeight.w600),),
),
onTap: () {
if(_latticeList[index].cellPublishStatus== 0){
return;
}
setState(() {
_selectPosition = index;
});
},
);
}),
),
)