Posts

Showing posts with the label #bottombar

Taxi Booking in flutter - BottomNavigationBar dart file

Image
 Create a dart file named as 'bottomnavigationbar.dart' in lib -> common folder. It will create bottom menu Please, support my blog by clicking on our sponsors ad! import 'package:flutter/material.dart'; import 'package:myfirstproject/Dashboard.dart'; import 'constants.dart'; class CommonBottomNavigationBar extends StatefulWidget { const CommonBottomNavigationBar({super.key, required this.pages}); final List<Widget> pages; @override State<CommonBottomNavigationBar> createState() => _CommonBottomNavigationBarState(); } class _CommonBottomNavigationBarState extends State<CommonBottomNavigationBar> { int _selectedIndex = 0; void _onItemTapped(int index) { setState(() { _selectedIndex = index; }); } @override Widget build(BuildContext context) { return BottomNavigationBar( items: const <BottomNavigationBarItem>[ BottomNavigationBarItem( ic