@@ -13,63 +13,65 @@ class HomeScreen extends StatelessWidget {
1313 Widget build (BuildContext context) {
1414 return BlocBuilder <HomeBloc , HomeState >(
1515 builder: (context, state) {
16- return Scaffold (
17- body: state.screen,
18- bottomNavigationBar: Container (
19- decoration: const BoxDecoration (
20- color: AppColors .white,
21- boxShadow: [
22- BoxShadow (
23- blurRadius: 16 ,
24- color: Color .fromRGBO (193 , 193 , 193 , 0.5 ),
25- offset: Offset (0 , - 4 ),
26- ),
27- ],
28- ),
29- child: Row (
30- mainAxisAlignment: MainAxisAlignment .spaceAround,
31- children: [
32- NavBarItem (
33- label: 'Feed' ,
34- isActive: state.selectedIndex == 0 ,
35- callback: () {
36- context
37- .read <HomeBloc >()
38- .add (const BottomNavItemPressed (index: 0 ));
39- },
40- icon: AppAssets .feed,
41- ),
42- NavBarItem (
43- label: 'Contests' ,
44- isActive: state.selectedIndex == 1 ,
45- callback: () {
46- context
47- .read <HomeBloc >()
48- .add (const BottomNavItemPressed (index: 1 ));
49- },
50- icon: AppAssets .contest,
51- ),
52- NavBarItem (
53- label: 'Search' ,
54- isActive: state.selectedIndex == 2 ,
55- callback: () {
56- context
57- .read <HomeBloc >()
58- .add (const BottomNavItemPressed (index: 2 ));
59- },
60- icon: AppAssets .search,
61- ),
62- NavBarItem (
63- label: 'Profile' ,
64- isActive: state.selectedIndex == 3 ,
65- callback: () {
66- context
67- .read <HomeBloc >()
68- .add (const BottomNavItemPressed (index: 3 ));
69- },
70- icon: AppAssets .profile,
71- ),
72- ],
16+ return SafeArea (
17+ child: Scaffold (
18+ body: state.screen,
19+ bottomNavigationBar: Container (
20+ decoration: const BoxDecoration (
21+ color: AppColors .white,
22+ boxShadow: [
23+ BoxShadow (
24+ blurRadius: 16 ,
25+ color: Color .fromRGBO (193 , 193 , 193 , 0.5 ),
26+ offset: Offset (0 , - 4 ),
27+ ),
28+ ],
29+ ),
30+ child: Row (
31+ mainAxisAlignment: MainAxisAlignment .spaceAround,
32+ children: [
33+ NavBarItem (
34+ label: 'Feed' ,
35+ isActive: state.selectedIndex == 0 ,
36+ callback: () {
37+ context
38+ .read <HomeBloc >()
39+ .add (const BottomNavItemPressed (index: 0 ));
40+ },
41+ icon: AppAssets .feed,
42+ ),
43+ NavBarItem (
44+ label: 'Contests' ,
45+ isActive: state.selectedIndex == 1 ,
46+ callback: () {
47+ context
48+ .read <HomeBloc >()
49+ .add (const BottomNavItemPressed (index: 1 ));
50+ },
51+ icon: AppAssets .contest,
52+ ),
53+ NavBarItem (
54+ label: 'Search' ,
55+ isActive: state.selectedIndex == 2 ,
56+ callback: () {
57+ context
58+ .read <HomeBloc >()
59+ .add (const BottomNavItemPressed (index: 2 ));
60+ },
61+ icon: AppAssets .search,
62+ ),
63+ NavBarItem (
64+ label: 'Profile' ,
65+ isActive: state.selectedIndex == 3 ,
66+ callback: () {
67+ context
68+ .read <HomeBloc >()
69+ .add (const BottomNavItemPressed (index: 3 ));
70+ },
71+ icon: AppAssets .profile,
72+ ),
73+ ],
74+ ),
7375 ),
7476 ),
7577 );
0 commit comments