Widget Maxcenter(RecordResultRecords item){ return Container( color: Color.fromRGBO(248,249,253,1), child: Column( children: [ MyDimens.height(height: 8), Text(item.createTime.substring(5,11) ?? "10/20", style: MyStyle.text_style_14_119, ), Container( width: MyDimens.getWidth(343), height: MyDimens.getHeight(109), margin: EdgeInsets.only( top: MyDimens.getHeight(10), right: MyDimens.getWidth(16), left: MyDimens.getWidth(16)), padding: EdgeInsets.only( top: MyDimens.getHeight(20), right: MyDimens.getWidth(16), left: MyDimens.getWidth(20) ), decoration: const BoxDecoration( color: Colors.white, borderRadius: BorderRadius.all(Radius.circular(10)), ), child: InkWell( child: Column( children: [ Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ Text('举报用户', style: MyStyle.text_style_16_0, ), Text('用户名称', style: MyStyle.text_style_16_254,), ], ), MyDimens.height(height: 14), Text(item.tmrDesc??'暂无数据', maxLines: 3, overflow: TextOverflow.ellipsis, style: MyStyle.text_style_12_102,textAlign: TextAlign.left, ) ], ), onTap: (){ RouteUtil.startActivity(context, Reportdetal()); }, )) ], ), ); }【在这里怎么吧05-29数据放在一起】如果有05-30的数据的话并显示【05-30的数据】注:5-29的数据和05-30的数据是分开的
时间: 2024-02-23 20:00:04 浏览: 160
你可以在这个Widget里面添加一个判断语句,判断当前的数据是否为05-29的数据,如果是,就显示05-29的数据,如果不是,就不显示。然后再添加一个类似的判断语句,判断当前的数据是否为05-30的数据,如果是,就显示05-30的数据,如果不是,就不显示。具体代码如下:
```
Widget Maxcenter(RecordResultRecords item){
return Container(
color: Color.fromRGBO(248,249,253,1),
child: Column(
children: [
MyDimens.height(height: 8),
Text(item.createTime.substring(5,11) ?? "10/20", style: MyStyle.text_style_14_119, ),
Container(
width: MyDimens.getWidth(343),
height: MyDimens.getHeight(109),
margin: EdgeInsets.only( top: MyDimens.getHeight(10), right: MyDimens.getWidth(16), left: MyDimens.getWidth(16)),
padding: EdgeInsets.only( top: MyDimens.getHeight(20), right: MyDimens.getWidth(16), left: MyDimens.getWidth(20) ),
decoration: const BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(Radius.circular(10)),
),
child: Column(
children: [
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text('举报用户', style: MyStyle.text_style_16_0, ),
Text('用户名称', style: MyStyle.text_style_16_254,),
],
),
MyDimens.height(height: 14),
Text(item.tmrDesc??'暂无数据', maxLines: 3, overflow: TextOverflow.ellipsis, style: MyStyle.text_style_12_102,textAlign: TextAlign.left, ),
if (item.createTime.substring(5,11) == "05-29") Text("05-29的数据"),
if (item.createTime.substring(5,11) == "05-30") Text("05-30的数据"),
],
),
onTap: (){ RouteUtil.startActivity(context, Reportdetal()); },
)
],
),
);
}
```
阅读全文
相关推荐

















