diff --git a/lib/presentation/views/main_menu/custom_navigation_bar.dart b/lib/presentation/views/main_menu/custom_navigation_bar.dart index a78a9f9..95dd408 100644 --- a/lib/presentation/views/main_menu/custom_navigation_bar.dart +++ b/lib/presentation/views/main_menu/custom_navigation_bar.dart @@ -63,40 +63,45 @@ class _CustomNavigationBarState extends State mainAxisSize: MainAxisSize.max, mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - IconButton( - icon: Icon( - Icons.home, - color: currentIndex == 0 ? Colors.white : Colors.black, - ), - onPressed: () => onTabTapped(0), - ), - IconButton( - icon: Icon( - Icons.history, - color: currentIndex == 1 ? Colors.white : Colors.black, - ), - onPressed: () => onTabTapped(1), - ), - IconButton( - icon: Icon( - Icons.groups, - color: currentIndex == 2 ? Colors.white : Colors.black, - ), - onPressed: () => onTabTapped(2), - ), - IconButton( - icon: Icon( - Icons.bar_chart, - color: currentIndex == 3 ? Colors.white : Colors.black, - ), - onPressed: () => onTabTapped(3), - ), + const SizedBox(width: 0), + _buildNavItem(Icons.home, 'Home', 0), + _buildNavItem(Icons.history, 'History', 1), + _buildNavItem(Icons.groups, 'Groups', 2), + _buildNavItem(Icons.bar_chart, 'Stats', 3), + const SizedBox(width: 0), ], ), ), ); } + Widget _buildNavItem(IconData icon, String label, int index) { + final isSelected = currentIndex == index; + + return GestureDetector( + onTap: () => onTabTapped(index), + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + Icon( + icon, + color: isSelected ? Colors.white : Colors.black, + ), + const SizedBox(height: 4), + Text( + label, + style: TextStyle( + color: isSelected ? Colors.white : Colors.black, + fontSize: 12, + fontWeight: isSelected ? FontWeight.bold : FontWeight.normal, + ), + ), + ], + ), + ); + } + void onTabTapped(int index) { setState(() { currentIndex = index;