Files
flux/lib/ui/home_screen.dart

68 lines
2.1 KiB
Dart
Raw Normal View History

2026-04-04 17:13:25 +02:00
import 'package:flutter/material.dart';
2026-04-07 11:30:22 +02:00
import 'package:flux/core/theme/theme.dart';
2026-04-04 17:13:25 +02:00
import 'package:flux/ui/anagrafiche/anagrafiche_main_view.dart';
import 'package:flux/ui/dashboard/dashboard_view.dart';
import 'package:flux/features/settings/settings_view.dart';
2026-04-04 17:13:25 +02:00
class HomeScreen extends StatefulWidget {
const HomeScreen({super.key});
@override
State<HomeScreen> createState() => _HomeScreenState();
}
class _HomeScreenState extends State<HomeScreen> {
int _selectedIndex = 0;
static const List<Widget> _widgetOptions = <Widget>[
DashboardView(), // Contiene Nuova Operazione
Placeholder(),
AnagraficheMainView(), // Gestisce [negozi, gestori, clienti, prodotti]
SettingsView(),
];
void _onItemTapped(int index) {
setState(() {
_selectedIndex = index;
});
}
@override
Widget build(BuildContext context) {
2026-04-05 10:06:26 +02:00
final surfaceColor = Theme.of(context).colorScheme.surface;
return Scaffold(
body: Center(child: _widgetOptions.elementAt(_selectedIndex)),
bottomNavigationBar: BottomNavigationBar(
items: const <BottomNavigationBarItem>[
BottomNavigationBarItem(
icon: Icon(Icons.dashboard_outlined),
activeIcon: Icon(Icons.dashboard),
label: 'Dashboard',
2026-04-04 17:13:25 +02:00
),
2026-04-05 10:06:26 +02:00
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: Theme.of(context).textTheme.bodyMedium?.color,
backgroundColor: surfaceColor,
type: BottomNavigationBarType.fixed,
onTap: _onItemTapped,
),
2026-04-04 17:13:25 +02:00
);
}
}