Commit e5d152a5 authored by jinzhu's avatar jinzhu

update time

parent 07997b2a
......@@ -44,22 +44,17 @@ class MessageItem extends StatelessWidget {
],
);
timeStr() {
// datefr
DateTime dateTime = DateTime.fromMicrosecondsSinceEpoch(message.time.toInt(), isUtc: false);
String timeStr() {
DateTime dateTime = DateTime.fromMicrosecondsSinceEpoch((message.time*1000*1000).toInt(), isUtc: false);
String time = dateTime.toString();
time = time.substring("yyyy-".length, "yyyy-MM-dd".length);
print('时间---------');
print(time);
return time;
}
var contenRow = new Row (
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
new Expanded(
child: new Text(message.content, maxLines: 2, textAlign: TextAlign.start, overflow: TextOverflow.ellipsis, style: TextStyle(color: Color(0xff323232), fontSize: 13, )),
)
],
......@@ -73,22 +68,20 @@ class MessageItem extends StatelessWidget {
var timeRow = new Row(
children: <Widget>[
new Expanded(
child: new Text(message.name),
)
new Text(timeStr(), maxLines: 1, overflow: TextOverflow.ellipsis, style: TextStyle(color: Color(0xff8e8e8e), fontSize: 10, )),
],
);
return new GestureDetector(
// onTap: onPressed,
onTap: timeStr(),
onTap: onPressed,
// onTap: timeStr(),
child: new Container(
child: new Column(
children: <Widget>[
new Row(
children: <Widget>[
new Padding(
padding: const EdgeInsets.only(left: 16, top: 20, bottom: 15),
padding: const EdgeInsets.only(left: 16, top: 20),
child: new Container(
child: new Center(
child: thumbImg,
......@@ -98,7 +91,7 @@ class MessageItem extends StatelessWidget {
new Expanded(
flex: 1,
child: new Padding(
padding: const EdgeInsets.all(10.0),
padding: const EdgeInsets.only(left: 10,right: 10, top: 10, bottom: 10),
child: new Column(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
......
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