import 'package:flutter/material.dart'; import '../../screens/dashboard/dashboard_screen.dart'; import '../../screens/history/history_screen.dart'; import '../../screens/billing/billing_screen.dart'; class CustomBottomNav extends StatefulWidget { const CustomBottomNav({super.key}); @override State createState() => _CustomBottomNavState(); } class _CustomBottomNavState extends State { int _currentIndex = 0; final List _screens = const [ DashboardScreen(), HistoryScreen(), BillingScreen(), ]; void _onTap(int index) { setState(() { _currentIndex = index; }); } @override Widget build(BuildContext context) { return Scaffold( body: _screens[_currentIndex], bottomNavigationBar: BottomNavigationBar( currentIndex: _currentIndex, onTap: _onTap, selectedItemColor: Colors.blueAccent, unselectedItemColor: Colors.grey, backgroundColor: Colors.white, type: BottomNavigationBarType.fixed, items: const [ BottomNavigationBarItem( icon: Icon(Icons.dashboard), label: 'Dashboard', ), BottomNavigationBarItem( icon: Icon(Icons.history), label: 'Riwayat', ), BottomNavigationBarItem( icon: Icon(Icons.receipt_long), label: 'Tagihan', ), ], ), ); } }