Skip to content

Commit 72611c7

Browse files
authored
Update bottom-nav-bar.dart
1 parent 748efe8 commit 72611c7

File tree

1 file changed

+49
-0
lines changed

1 file changed

+49
-0
lines changed

bottom-nav-bar.dart

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,52 @@ class _ChatPageState extends State<ChatPage> {
3232
);
3333
}
3434
}
35+
36+
37+
-----------------------------/\/\/\/\/\/\\/\/\/\/\/\/\/\\/\/\/\/\/\/\----------------------------------------------------------
38+
39+
//Bottom navbar with circle avartar + change of icons when moved from one page to another
40+
41+
Scaffold(
42+
body: _children[_selectedIndex],
43+
bottomNavigationBar: BottomNavigationBar(
44+
type: BottomNavigationBarType.fixed,
45+
selectedIconTheme: IconThemeData(color: pPrimaryColor),
46+
currentIndex: _selectedIndex,
47+
backgroundColor: !isDark?Colors.white:Colors.black,
48+
selectedItemColor: isDark?Colors.grey:Colors.black,
49+
showSelectedLabels: false,
50+
showUnselectedLabels: false,
51+
elevation: 0,
52+
onTap: (value) {
53+
setState(() {
54+
_selectedIndex = value;
55+
});
56+
},
57+
items: [
58+
BottomNavigationBarItem(
59+
icon: _selectedIndex==0?Icon(Icons.home,color: Colors.black,size: 28,): Icon(Icons.home_outlined,color: Colors.black,size: 28,),label: 'home'),
60+
BottomNavigationBarItem(icon: _selectedIndex==1?Icon(Icons.search,color: Colors.black,size: 28,): Icon(Icons.search_outlined,color: Colors.black,size: 28,),label: 'search'),
61+
BottomNavigationBarItem(icon: _selectedIndex==2?Icon(Icons.video_collection_sharp,color: Colors.black,size: 28,): Icon(Icons.video_collection_outlined,color: Colors.black,size: 28,),label: 'reels' ),
62+
BottomNavigationBarItem(icon: _selectedIndex==3?Icon(Icons.favorite,color: Colors.black,size: 28,):Icon(Icons.favorite_border_outlined,color: Colors.black,size: 28,),label: 'notif'),
63+
BottomNavigationBarItem(icon: _selectedIndex==4?
64+
CircleAvatar(
65+
radius: 14,
66+
backgroundColor: Colors.black,
67+
child: CircleAvatar(
68+
radius: 13,
69+
backgroundImage:AssetImage('assets/profilepic.jpg') ,),
70+
):
71+
CircleAvatar(
72+
radius: 14,
73+
backgroundImage:AssetImage('assets/profilepic.jpg') ,),
74+
label: 'profile'
75+
),
76+
77+
],
78+
79+
),
80+
);
81+
82+
83+

0 commit comments

Comments
 (0)