-
Notifications
You must be signed in to change notification settings - Fork 9
/
home.dart
83 lines (77 loc) · 2.35 KB
/
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
72
73
74
75
76
77
78
79
80
81
82
83
import 'package:ecellapp/core/res/colors.dart';
import 'package:ecellapp/screens/home/tabs/app_team/app_team.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:salomon_bottom_bar/salomon_bottom_bar.dart';
import 'tabs/contact_us.dart';
import 'tabs/menu.dart';
import 'tabs/profile.dart';
class HomeScreen extends StatefulWidget {
@override
_HomeScreenState createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
int _currentIndex = 1;
final List<Widget> _children = [
ProfileScreen(),
MenuScreen(),
ContactUsScreen(),
AppTeamScreen()
];
@override
Widget build(BuildContext context) {
return Scaffold(
resizeToAvoidBottomInset: false,
bottomNavigationBar: _buildBottomNavBar(context),
body: _children[_currentIndex],
);
}
Widget _buildBottomNavBar(context) {
double height = MediaQuery.of(context).size.height;
double heightFactor = height / 1000;
return SalomonBottomBar(
backgroundColor: C.backgroundBottom,
unselectedItemColor: C.menuButtonColor,
currentIndex: _currentIndex,
onTap: (i) => setState(() => _currentIndex = i),
items: [
/// Profile
SalomonBottomBarItem(
icon: Icon(Icons.person,
size: 30 * heightFactor,
),
title: Text("Profile",style: TextStyle(fontSize: 22*heightFactor),),
selectedColor: C.menuButtonColor,
),
/// Home
SalomonBottomBarItem(
icon: Icon(Icons.home,size: 30 * heightFactor ,),
title: Text("Home",
style: TextStyle(fontSize: 22 * heightFactor),
),
selectedColor: C.menuButtonColor,
),
/// Contact
SalomonBottomBarItem(
icon: Icon(Icons.call,
size: 30 * heightFactor,
),
title: Text("Contact",
style: TextStyle(fontSize: 22 * heightFactor),
),
selectedColor: C.menuButtonColor
),
///App team
SalomonBottomBarItem(
icon: Icon(Icons.flutter_dash_outlined,
size: 30 * heightFactor,
),
title: Text("App Team",
style: TextStyle(fontSize: 22 * heightFactor),
),
selectedColor: C.menuButtonColor
),
],
);
}
}