-
Notifications
You must be signed in to change notification settings - Fork 18
/
Copy pathwhatsapp_home.dart
71 lines (68 loc) · 2.01 KB
/
whatsapp_home.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
import 'package:flutter/material.dart';
import 'package:flutter_whatsapp/pages/call_screen.dart';
import 'package:flutter_whatsapp/pages/camera_screen.dart';
import 'package:flutter_whatsapp/pages/chat_screen.dart';
import 'package:flutter_whatsapp/pages/status_screen.dart';
class WhatsAppHome extends StatefulWidget {
@override
_WhatsAppHomeState createState() => new _WhatsAppHomeState();
}
class _WhatsAppHomeState extends State<WhatsAppHome>
with SingleTickerProviderStateMixin {
TabController _tabController;
@override
void initState() {
// TODO: implement initState
super.initState();
_tabController = new TabController(vsync: this, initialIndex: 1, length: 4);
}
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(
title: new Text("WhatsApp"),
elevation: 0.7,
bottom: new TabBar(
controller: _tabController,
indicatorColor: Colors.white,
tabs: <Widget>[
new Tab(icon: new Icon(Icons.camera_alt)),
new Tab(
text: "CHATS",
),
new Tab(
text: "STATUS",
),
new Tab(
text: "CHATS",
)
],
),
actions: <Widget>[
new Icon(Icons.search),
new Padding(
padding: const EdgeInsets.symmetric(horizontal: 5.0),
),
new Icon(Icons.more_vert)
],
),
body: new TabBarView(
controller: _tabController,
children: <Widget>[
new CameraScreen(),
new ChatScreen(),
new StatusScreen(),
new CallScreen(),
],
),
floatingActionButton: new FloatingActionButton(
backgroundColor: Theme.of(context).accentColor,
child: new Icon(
Icons.message,
color: Colors.white,
),
onPressed: () => print("open chats"),
),
);
}
}