forked from Tembhum/Backpack-1
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.dart
More file actions
54 lines (51 loc) · 1.52 KB
/
home.dart
File metadata and controls
54 lines (51 loc) · 1.52 KB
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
import 'package:flutter/material.dart';
import 'display.dart';
class Home extends StatefulWidget{
State<StatefulWidget> createState()=> HomeState();
}
class HomeState extends State<Home>{
int currentindex=0;
final List<Widget> _children =[
DisplayWidget(Colors.pink),
DisplayWidget(Colors.red),
DisplayWidget(Colors.green),
DisplayWidget(Colors.blue),
];
Widget build(BuildContext context){
return Scaffold(
// appBar: AppBar(
// title: Text('BottomBar'),
// ),
body: _children[currentindex],
bottomNavigationBar: BottomNavigationBar(
currentIndex: currentindex,
onTap:onTabTapped,
fixedColor: Colors.pink[200],
type: BottomNavigationBarType.fixed,
items: <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.home),
title: Text('Home'),
),
BottomNavigationBarItem(
icon: Icon(Icons.create),
title: Text('Lent'),
),
BottomNavigationBarItem(
icon: Icon(Icons.history),
title: Text('session'),
),
BottomNavigationBarItem(
icon: Icon(Icons.face),
title:Text('Profile'),
),
]
),
);
}
void onTabTapped(int index){
setState(() {
currentindex =index;
});
}
}