-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.dart
64 lines (58 loc) · 1.84 KB
/
main.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
import 'package:church/pages/chats.dart';
import 'package:church/pages/groups.dart';
import 'package:church/pages/lessons.dart';
import 'package:church/pages/loginpage.dart';
import 'package:church/pages/social.dart';
import 'package:church/pages/verse.dart';
import 'package:firebase_core/firebase_core.dart';
import 'package:flutter/material.dart';
void main() async {
runApp(const MaterialApp(
home: Login(),
debugShowCheckedModeBanner: false,
));
await Firebase.initializeApp();
}
class Home extends StatefulWidget {
const Home({Key? key}) : super(key: key);
@override
State<Home> createState() => _HomeState();
}
class _HomeState extends State<Home> {
final List<Widget> navigationPages = const [
Chats(),
Groups(),
Verse(),
Lessons(),
Social()
];
int currentPage = 0;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: Colors.transparent,
elevation: 0.0,
),
body: navigationPages[currentPage],
bottomNavigationBar: BottomNavigationBar(
type: BottomNavigationBarType.fixed,
backgroundColor: Colors.white,
selectedItemColor: Colors.deepPurple,
currentIndex: currentPage,
onTap: ((value) => setState(() {
currentPage = value;
})),
items: const [
BottomNavigationBarItem(icon: Icon(Icons.chat), label: 'chat'),
BottomNavigationBarItem(icon: Icon(Icons.group), label: 'groups'),
BottomNavigationBarItem(
icon: Icon(Icons.menu_book), label: 'verse'),
BottomNavigationBarItem(
icon: Icon(Icons.local_library), label: 'lesson'),
BottomNavigationBarItem(
icon: Icon(Icons.image_search_rounded), label: 'social')
]),
);
}
}