Commit 9067fe86 authored by 杜欣's avatar 杜欣

merge

parents 814f5430 53e588eb
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/AttentionEntity.dart'; import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/AttentionEntity.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/message_date.dart'; import 'package:gmalpha_flutter/NewMessageModel/util/message_date.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart'; import 'package:gmalpha_flutter/res/value/ALColors.dart';
class AttentionListItem extends StatelessWidget { class AttentionListItem extends StatelessWidget {
...@@ -27,59 +27,66 @@ class AttentionListItem extends StatelessWidget { ...@@ -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 @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return SizedBox( return Container(
child: Card( child: Row(
elevation: 0.0, crossAxisAlignment: CrossAxisAlignment.start,
child: Row( children: <Widget>[
crossAxisAlignment: CrossAxisAlignment.start, listItemHead(),
children: <Widget>[ listItemInfo(),
Padding( listItemButton()
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)
),
)
)
],
),
), ),
); );
} }
......
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/AttentionModel.dart'; import 'package:gmalpha_flutter/NewMessageModel/page/AttentionModel.dart';
...@@ -82,15 +83,19 @@ class _AttentionPageState extends BasePage<AttentionPage> { ...@@ -82,15 +83,19 @@ class _AttentionPageState extends BasePage<AttentionPage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( 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( child: Text(
'通知', '通知',
style: TextStyle(fontSize: 20.0, color: ALColors.Color323232), style: TextStyle(fontSize: 20.0, color: ALColors.Color323232),
), ),
), ),
Divider( Container(
color: ALColors.ColorE4E4E4, margin: const EdgeInsets.only(left: 15.0, right: 15.0),
), child: Divider(
height: 1.0,
color: ALColors.ColorE4E4E4,
),
)
], ],
); );
} }
...@@ -107,7 +112,7 @@ class _AttentionPageState extends BasePage<AttentionPage> { ...@@ -107,7 +112,7 @@ class _AttentionPageState extends BasePage<AttentionPage> {
return _buildProgressIndicator(); return _buildProgressIndicator();
} }
return Padding( 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]), child: AttentionListItem(_noticeLists[index]),
); );
} }
......
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart'; import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart'; import 'package:gmalpha_flutter/Annotations/RouterCenterRestore.mark.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/message_date.dart'; import 'package:gmalpha_flutter/NewMessageModel/util/message_date.dart';
import 'package:gmalpha_flutter/res/value/ALColors.dart'; import 'package:gmalpha_flutter/res/value/ALColors.dart';
......
...@@ -3,7 +3,7 @@ class MessageDate { ...@@ -3,7 +3,7 @@ class MessageDate {
int _currentDate; int _currentDate;
MessageDate(this.time); MessageDate(this.time);
String diffTime () { String diffTime() {
var date = DateTime.now(); var date = DateTime.now();
int serverTime = (time * 1000).toInt(); int serverTime = (time * 1000).toInt();
_currentDate = date.millisecondsSinceEpoch; _currentDate = date.millisecondsSinceEpoch;
......
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