提交 0d614983 authored 作者: yueweilu's avatar yueweilu

分类少的时候 靠左显示问题

上级 7a008415
......@@ -36,6 +36,7 @@ class _FilterPageState extends State<FilterPage> {
width: double.infinity,
padding: EdgeInsets.only(bottom: 10.w),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.start,
......@@ -111,50 +112,53 @@ class _FilterPageState extends State<FilterPage> {
margin: EdgeInsets.only(left: 10.w,bottom: 10.w,top: 10.w),
child: Text(title,style: TextStyle(fontSize: 15.w,height:1.6,color: Colours.c3,fontWeight: Fonts.boldSemi),)
),
Wrap(
spacing: 10,
runSpacing: 10,
alignment: WrapAlignment.start,
runAlignment: WrapAlignment.start,
children: data.map((model){
return GestureDetector(
onTap: (){
setState(() {
for (FilterModel model in data){
model.selected = false;
}
model.selected = !model.selected;
if (model.name == '读过' || model.name == '评分'){
if(model.selected){
model.up = !model.up;
Container(
margin: EdgeInsets.only(left: 10.w),
child: Wrap(
spacing: 10,
runSpacing: 10,
alignment: WrapAlignment.start,
runAlignment: WrapAlignment.start,
children: data.map((model){
return GestureDetector(
onTap: (){
setState(() {
for (FilterModel model in data){
model.selected = false;
}
else{
model.up = true;
model.selected = !model.selected;
if (model.name == '读过' || model.name == '评分'){
if(model.selected){
model.up = !model.up;
}
else{
model.up = true;
}
}
}
});
},
child: Container(
height: 27,
padding: const EdgeInsets.only(left: 15,right: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(13.5),
color: model.selected?const Color(0xFFC02D55).withOpacity(0.08): Colours.cF4,
border: model.selected?Border.all(width: 0.5.w,color: AppTheme.primary):null
});
},
child: Container(
height: 27,
padding: const EdgeInsets.only(left: 15,right: 15),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(13.5),
color: model.selected?const Color(0xFFC02D55).withOpacity(0.08): Colours.cF4,
border: model.selected?Border.all(width: 0.5.w,color: AppTheme.primary):null
),
child: model.name == '读过' || model.name == '评分'?Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(model.name??'',style: TextStyle(fontSize: 13,height: 1.4,color: model.selected?AppTheme.primary: Colours.c3),textAlign: TextAlign.center,),
Image.asset(model.selected?model.up?'assets/images/filter_up.png':'assets/images/filter_down.png':'assets/images/filter_unselect.png'),
],
):Padding(padding: EdgeInsets.only(top: 4.w),child: Text(model.name??'',style: TextStyle(fontSize: 13,height: 1.4,color: model.selected?AppTheme.primary: Colours.c3),textAlign: TextAlign.end,),),
),
child: model.name == '读过' || model.name == '评分'?Row(
mainAxisSize: MainAxisSize.min,
children: [
Text(model.name??'',style: TextStyle(fontSize: 13,height: 1.4,color: model.selected?AppTheme.primary: Colours.c3),textAlign: TextAlign.center,),
Image.asset(model.selected?model.up?'assets/images/filter_up.png':'assets/images/filter_down.png':'assets/images/filter_unselect.png'),
],
):Padding(padding: EdgeInsets.only(top: 4.w),child: Text(model.name??'',style: TextStyle(fontSize: 13,height: 1.4,color: model.selected?AppTheme.primary: Colours.c3),textAlign: TextAlign.end,),),
),
);
}).toList(),
),
);
}).toList(),
),
)
],
);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论