提交 1c2024f2 authored 作者: 岳维路's avatar 岳维路

合并分支 'test' 到 'sim'

分类少的时候 靠左显示问题 查看合并请求 kiwitap/zijing-app!11
...@@ -36,6 +36,7 @@ class _FilterPageState extends State<FilterPage> { ...@@ -36,6 +36,7 @@ class _FilterPageState extends State<FilterPage> {
width: double.infinity, width: double.infinity,
padding: EdgeInsets.only(bottom: 10.w), padding: EdgeInsets.only(bottom: 10.w),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Column( Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
...@@ -111,50 +112,53 @@ class _FilterPageState extends State<FilterPage> { ...@@ -111,50 +112,53 @@ class _FilterPageState extends State<FilterPage> {
margin: EdgeInsets.only(left: 10.w,bottom: 10.w,top: 10.w), 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),) child: Text(title,style: TextStyle(fontSize: 15.w,height:1.6,color: Colours.c3,fontWeight: Fonts.boldSemi),)
), ),
Wrap( Container(
spacing: 10, margin: EdgeInsets.only(left: 10.w),
runSpacing: 10, child: Wrap(
alignment: WrapAlignment.start, spacing: 10,
runAlignment: WrapAlignment.start, runSpacing: 10,
children: data.map((model){ alignment: WrapAlignment.start,
return GestureDetector( runAlignment: WrapAlignment.start,
onTap: (){ children: data.map((model){
setState(() { return GestureDetector(
for (FilterModel model in data){ onTap: (){
model.selected = false; setState(() {
} for (FilterModel model in data){
model.selected = !model.selected; model.selected = false;
if (model.name == '读过' || model.name == '评分'){
if(model.selected){
model.up = !model.up;
} }
else{ model.selected = !model.selected;
model.up = true; if (model.name == '读过' || model.name == '评分'){
if(model.selected){
model.up = !model.up;
}
else{
model.up = true;
}
} }
} });
}); },
}, child: Container(
child: Container( height: 27,
height: 27, padding: const EdgeInsets.only(left: 15,right: 15),
padding: const EdgeInsets.only(left: 15,right: 15), decoration: BoxDecoration(
decoration: BoxDecoration( borderRadius: BorderRadius.circular(13.5),
borderRadius: BorderRadius.circular(13.5), color: model.selected?const Color(0xFFC02D55).withOpacity(0.08): Colours.cF4,
color: model.selected?const Color(0xFFC02D55).withOpacity(0.08): Colours.cF4, border: model.selected?Border.all(width: 0.5.w,color: AppTheme.primary):null
border: model.selected?Border.all(width: 0.5.w,color: AppTheme.primary):null
), ),
child: model.name == '读过' || model.name == '评分'?Row( child: model.name == '读过' || model.name == '评分'?Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
Text(model.name??'',style: TextStyle(fontSize: 13,height: 1.4,color: model.selected?AppTheme.primary: Colours.c3),textAlign: TextAlign.center,), 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'), 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,),), ):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 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论