import 'package:flutter/material.dart'; import 'package:flux/theme.dart'; import 'package:flux/ui/anagrafiche/anagrafiche_main_view.dart'; import 'package:flux/ui/dashboard/dashboard_view.dart'; import 'package:flux/ui/settings/settings_view.dart'; class HomeScreen extends StatefulWidget { const HomeScreen({super.key}); @override State createState() => _HomeScreenState(); } class _HomeScreenState extends State { int _selectedIndex = 0; static const List _widgetOptions = [ DashboardView(), // Contiene Nuova Operazione Placeholder(), AnagraficheMainView(), // Gestisce [negozi, gestori, clienti, prodotti] SettingsView(), ]; void _onItemTapped(int index) { setState(() { _selectedIndex = index; }); } @override Widget build(BuildContext context) { return Scaffold( body: Center(child: _widgetOptions.elementAt(_selectedIndex)), bottomNavigationBar: BottomNavigationBar( items: const [ BottomNavigationBarItem( icon: Icon(Icons.dashboard_outlined), activeIcon: Icon(Icons.dashboard), label: 'Dashboard', ), BottomNavigationBarItem( icon: Icon(Icons.history_edu_outlined), activeIcon: Icon(Icons.history_edu), label: 'Operazioni', ), BottomNavigationBarItem( icon: Icon(Icons.people_alt_outlined), activeIcon: Icon(Icons.people_alt), label: 'Anagrafiche', ), BottomNavigationBarItem( icon: Icon(Icons.settings_outlined), activeIcon: Icon(Icons.settings), label: 'Impostazioni', ), ], currentIndex: _selectedIndex, selectedItemColor: FluxColors.accentTurquoise, unselectedItemColor: FluxColors.textSecondary, backgroundColor: FluxColors.surface, type: BottomNavigationBarType.fixed, onTap: _onItemTapped, ), ); } }