-
Notifications
You must be signed in to change notification settings - Fork 0
/
Chats.dart
64 lines (62 loc) · 2.01 KB
/
Chats.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
63
64
import 'dart:ui';
import 'package:flutter/material.dart';
import 'package:works/Model/ChatsModel.dart';
class Chats extends StatefulWidget {
@override
_ChatsState createState() => _ChatsState();
}
class _ChatsState extends State<Chats> {
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: [
ListView.builder(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
itemCount: chatsData.length,
itemBuilder: (BuildContext context, int i) {
return Column(
children: [
ListTile(
leading: CircleAvatar(
backgroundColor: Colors.grey,
backgroundImage: NetworkImage(chatsData[i].pic),
),
title: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Text(
chatsData[i].name,
style: TextStyle(
fontSize: 13.0,
fontWeight: FontWeight.bold,
),
),
Text(
chatsData[i].time,
style: TextStyle(
fontSize: 11.0,
color: Colors.grey,
),
),
],
),
subtitle: Text(
chatsData[i].msg,
style: TextStyle(
color: Colors.grey,
fontSize: 11.8,
),
),
),
Divider(height: 0.1),
],
);
},
),
],
),
);
}
}