-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome_screen.dart
128 lines (122 loc) · 3.99 KB
/
home_screen.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
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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import 'package:ch5/screen_two.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class HomeScreen extends StatefulWidget {
const HomeScreen({super.key});
static const String id = 'home_screen';
@override
State<HomeScreen> createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
@override
Widget build(BuildContext context) {
return DefaultTabController(
length: 4,
child: Scaffold(
appBar: AppBar(
centerTitle: false,
title: Text("WhatsApp"),
bottom: TabBar(tabs: [
Tab(
child: Icon(Icons.camera_alt),
),
Tab(
child: Text(' Chat'),
),
Tab(
child: Text('Status'),
),
Tab(
child: Text('Call'),
)
]),
actions: [
//
// Icon(Icons.search),
PopupMenuButton(
icon: Icon(Icons.search),
itemBuilder: (
context,
) =>
[
PopupMenuItem(value: 1, child: Text("New Contact")),
PopupMenuItem(value: 2, child: Text("Contact"))
]),
SizedBox(
width: 10,
),
// Icon(Icons.more_horiz),
PopupMenuButton(
icon: Icon(Icons.more_horiz_rounded),
itemBuilder: (
context,
) =>
[PopupMenuItem(value: 1, child: Text("New Groups")),
PopupMenuItem(value: 2, child: Text("Setting")),
PopupMenuItem(value: 3, child: Text("Log out")),
]),
SizedBox(
width: 15,
)
],
),
body: TabBarView(children: [
// Camera view
Center(
child: CircleAvatar(
backgroundImage: AssetImage
("Image/Ahmed.jpg"),
radius: 200,
),
),
// Chat box
ListView.builder(
itemCount: 15,
itemBuilder: (context, index) {
return const ListTile(
title: Text("Mmuzammil Ahmed"),
trailing: Text("10;35 am"),
subtitle: Text("How are you ?"),
leading: CircleAvatar(
backgroundImage: AssetImage("Image/Ahmed.jpg"),
),
);
}),
/// Status code
ListView.builder(
itemCount: 100,
itemBuilder: (context, index) {
return ListTile(
leading: Container(
decoration: BoxDecoration(
shape: BoxShape.circle,
border: Border.all(color: Colors.teal, width: 3)),
child: CircleAvatar(
backgroundImage: AssetImage("Image/Ahmed.jpg"),
),
),
title: Text("Muzammil"),
subtitle: Text("32 minutes ago"),
);
}),
// Call code
ListView.builder(
itemCount: 100,
itemBuilder: (context, index) {
return ListTile(
title: Text("Ahmad"),
subtitle: Text(index % 2 == 0
? " you missed call"
: "You always missed video 10 call"),
trailing: Icon(
index % 2 == 0 ? Icons.phone : Icons.video_camera_back),
leading: CircleAvatar(
backgroundImage: AssetImage('Image/Ahmed.jpg'),
),
);
})
]),
),
);
}
}