1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/model/message/message.dart';
import 'package:gmalpha_flutter/macros/ALColors.dart';
class MessageNotificationItem extends StatelessWidget {
final NotificationItem notification;
VoidCallback onPressed;
MessageNotificationItem({Key key, this.notification, this.onPressed}) : super(key: key);
@override
Widget build(BuildContext context) {
var icon = new Container(
child: new Padding(
padding: EdgeInsets.only(left: 20, top: 17, bottom: 17),
child: ImageIcon(
AssetImage(notification.icon),
color: ALColors.Color323232,
size: 30,
),
)
);
var titleRow = new Container(
width: 250,
child: new Row(
children: <Widget>[
Text(notification.title, style: TextStyle(color: Color(0xff323232), fontWeight: FontWeight.bold, fontSize: 13)),
Padding(padding: EdgeInsets.only(left: 8)),
new Expanded(
child: Text(notification.content, maxLines: 1, overflow: TextOverflow.ellipsis, style: new TextStyle(color: Color(0xff8e8e8e), fontSize: 13,), textAlign: TextAlign.justify,),
)
],
),
// child: Text(notification.content, maxLines: 1, overflow: TextOverflow.ellipsis, style: new TextStyle(color: Color(0xff8e8e8e), fontSize: 13,), textAlign: TextAlign.justify,),
);
Widget _notiContent() {
var content;
if (notification.count > 0 ){
content = new ClipRRect(
borderRadius: BorderRadius.circular(11),
child: new Container(
height: 22,
color: ALColors.Color323232,
child: Padding(
padding: EdgeInsets.only(top: 4.5, left: 9, right: 9),
child: Text(notification.count.toString(), style: TextStyle(color: Color(0xffffffff),fontSize: 11),),
),
),
);
} else {
content = new Container(height:0.0,width:0.0);
}
return content;
}
var rigtIcon = new Expanded(
child: new Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
_notiContent(),
new Padding(
padding: EdgeInsets.only(right: 5),
child: new ImageIcon(
AssetImage('images/arrow_right.png'),
color: ALColors.Color323232,
// size: 30,
),
)
],
),
);
return new GestureDetector(
onTap: onPressed,
// onTap: timeStr(),
child: new Row(
children: <Widget>[
icon,
Padding(padding: new EdgeInsets.only(left: 13.0)),
titleRow,
rigtIcon,
// arrow,
],
),
);
}
}