Files
flux/lib/ui/home_screen.dart

67 lines
2.0 KiB
Dart

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<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) {
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',
),
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,
),
);
}
}