Commit 53e588eb authored by 郑智刚's avatar 郑智刚

结构样式优化

parent 16c6f695
......@@ -27,59 +27,66 @@ class AttentionListItem extends StatelessWidget {
);
}
Widget listItemHead() {
return Container(
margin: const EdgeInsets.only(right: 10.0),
child: CircleAvatar(
radius: 21.0,
backgroundImage: NetworkImage(item.icon),
),
);
}
Widget listItemInfo() {
return Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: myText('${item.title}', ALColors.Color464646, 13.0, weight: true),
),
Padding(
padding: const EdgeInsets.only(top: 4.0),
child: myText('${item.content}', ALColors.Color666666, 13.0, maxLines: 2),
),
Padding(
padding: const EdgeInsets.only(top: 3.0),
child: myText(MessageDate(item.pushTime).diffTime(), ALColors.Color999999, 10.0)
)
],
),
);
}
Widget listItemButton() {
return Container(
padding: const EdgeInsets.only(top: 5.0, left: 12.0),
width: 66.0,
height: 34.0,
child: OutlineButton(
padding: const EdgeInsets.only(left: 0.0, right: 0.0,),
borderSide: BorderSide(
color: ALColors.Color323232
),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.zero),
onPressed: () {
// todo 跳转到原生页面 详情页面
},
child: myText('详情', ALColors.Color323232, 13.0)
),
);
}
@override
Widget build(BuildContext context) {
return SizedBox(
child: Card(
elevation: 0.0,
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 5.0, left: 16.0, right: 10.0),
child: CircleAvatar(
radius: 21.0,
backgroundImage: NetworkImage(item.icon),
),
),
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
child: myText('${item.title}', ALColors.Color464646, 13.0, weight: true),
),
Padding(
padding: const EdgeInsets.only(top: 4.0),
child: myText('${item.content}', ALColors.Color666666, 13.0, maxLines: 2),
),
Padding(
padding: const EdgeInsets.only(top: 3.0),
child: myText(MessageDate(item.pushTime).diffTime(), ALColors.Color999999, 10.0)
)
],
),
),
Padding(
padding: const EdgeInsets.only(top: 4.0, left: 12.0, right: 16.0),
child: Container(
width: 54.0,
height: 29.0,
child: OutlineButton(
padding: const EdgeInsets.only(left: 0.0, right: 0.0,),
borderSide: BorderSide(
color: ALColors.Color323232
),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.zero),
onPressed: () {
// todo 跳转到原生页面 详情页面
},
child: myText('详情', ALColors.Color323232, 13.0)
),
)
)
],
),
return Container(
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
listItemHead(),
listItemInfo(),
listItemButton()
],
),
);
}
......
......@@ -83,15 +83,19 @@ class _AttentionPageState extends BasePage<AttentionPage> {
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Padding(
padding: const EdgeInsets.only(top: 16.0, left: 16.0, right: 16.0, bottom: 10.0),
padding: const EdgeInsets.only(top: 5.0, left: 16.0, right: 16.0, bottom: 29.0),
child: Text(
'通知',
style: TextStyle(fontSize: 20.0, color: ALColors.Color323232),
),
),
Divider(
color: ALColors.ColorE4E4E4,
),
Container(
margin: const EdgeInsets.only(left: 15.0, right: 15.0),
child: Divider(
height: 1.0,
color: ALColors.ColorE4E4E4,
),
)
],
);
}
......@@ -108,7 +112,7 @@ class _AttentionPageState extends BasePage<AttentionPage> {
return _buildProgressIndicator();
}
return Padding(
padding: const EdgeInsets.only(bottom: 21.0),
padding: const EdgeInsets.only(bottom: 16.0, top: 16.0, left: 15.0, right: 15.0),
child: AttentionListItem(_noticeLists[index]),
);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment