-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhome.dart
47 lines (43 loc) · 1.37 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
import 'package:flutter/material.dart';
import 'package:interco/ui/quiz/quiz.dart';
import 'package:interco/ui/reference/reference.dart';
class Home extends StatefulWidget {
@override
State<StatefulWidget> createState() {
return _HomeState();
}
}
class _HomeState extends State<Home> {
int _selectedTabIndex = 0;
final List<Widget> _tabContent = [
ReferenceWidget(),
QuizWidget(),
Center(child: Text("Statistics")),
];
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text("Interco"),
),
bottomNavigationBar: BottomNavigationBar(
onTap: onTabSelected,
currentIndex: _selectedTabIndex,
items: [
BottomNavigationBarItem(
icon: Icon(Icons.list), title: Text("Reference")),
BottomNavigationBarItem(
icon: Icon(Icons.live_help), title: Text("Quiz")),
BottomNavigationBarItem(
icon: Icon(Icons.account_box),
title: Text("Statistics"))
]),
body: _tabContent[_selectedTabIndex],
);
}
void onTabSelected(int index) {
setState(() {
_selectedTabIndex = index;
});
}
}