-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathChat2.dart
62 lines (57 loc) · 1.96 KB
/
Chat2.dart
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
import 'package:flutter/material.dart';
import 'chat_detail_page.dart';
// ignore: must_be_immutable
class ChatUsersList extends StatefulWidget{
String text;
String secondaryText;
String image;
String time;
bool isMessageRead;
ChatUsersList({@required this.text,@required this.secondaryText,@required this.image,@required this.time,@required this.isMessageRead});
@override
_ChatUsersListState createState() => _ChatUsersListState();
}
class _ChatUsersListState extends State<ChatUsersList> {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: (){
Navigator.push(context, MaterialPageRoute(builder: (context){
return ChatDetailPage();
}));
},
child: Container(
padding: EdgeInsets.only(left: 16,right: 16,top: 10,bottom: 10),
child: Row(
children: <Widget>[
Expanded(
child: Row(
children: <Widget>[
CircleAvatar(
backgroundImage: AssetImage(widget.image),
maxRadius: 30,
),
SizedBox(width: 16,),
Expanded(
child: Container(
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(widget.text),
SizedBox(height: 6,),
Text(widget.secondaryText,style: TextStyle(fontSize: 14,color: Colors.grey.shade500),),
],
),
),
),
],
),
),
Text(widget.time,style: TextStyle(fontSize: 12,color: widget.isMessageRead?Colors.pink:Colors.grey.shade500),),
],
),
),
);
}
}