import 'package:flutter/material.dart'; import '../utils/constants.dart'; import 'dashboard_screen.dart'; import 'home_screen.dart'; import 'siti_screen.dart'; import 'profile_screen.dart'; class MainScreen extends StatefulWidget { const MainScreen({super.key}); @override State createState() => _MainScreenState(); } class _MainScreenState extends State { int _currentIndex = 0; final List _screens = [ const DashboardScreen(), const HomeScreen(), const SitiScreen(), const ProfileScreen(), ]; @override Widget build(BuildContext context) { return Scaffold( body: _screens[_currentIndex], bottomNavigationBar: BottomNavigationBar( currentIndex: _currentIndex, onTap: (index) => setState(() => _currentIndex = index), selectedItemColor: AppColors.primary, unselectedItemColor: AppColors.textSecondary, items: const [ BottomNavigationBarItem( icon: Icon(Icons.dashboard), label: 'Dashboard', ), BottomNavigationBarItem( icon: Icon(Icons.notifications_active), label: 'Allarmi', ), BottomNavigationBarItem( icon: Icon(Icons.location_on), label: 'Siti', ), BottomNavigationBarItem( icon: Icon(Icons.person), label: 'Profilo', ), ], ), ); } }