buono
This commit is contained in:
@@ -89,10 +89,16 @@ class _AppMenuState extends State<AppMenu> {
|
||||
Icon(Icons.bolt, color: theme.colorScheme.primary, size: 32),
|
||||
if (!effectivelyCollapsed) ...[
|
||||
const SizedBox(width: 12),
|
||||
Text(
|
||||
"FLUX",
|
||||
style: theme.textTheme.titleLarge?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
if (widget.isDrawer) Navigator.pop(context);
|
||||
context.goNamed(Routes.home);
|
||||
},
|
||||
child: Text(
|
||||
"FLUX",
|
||||
style: theme.textTheme.titleLarge?.copyWith(
|
||||
fontWeight: FontWeight.bold,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
@@ -111,13 +117,36 @@ class _AppMenuState extends State<AppMenu> {
|
||||
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||
children: [
|
||||
_buildRouteItem(
|
||||
title: context.l10n.commonDashboard,
|
||||
title: 'Dashboard',
|
||||
icon: Icons.dashboard_outlined,
|
||||
routeName: Routes.home, // <--- Usiamo la tua costante!
|
||||
routeName: Routes.home,
|
||||
pathToCheck:
|
||||
'/', // Il path da controllare per colorarlo
|
||||
isCollapsed: effectivelyCollapsed,
|
||||
),
|
||||
const SizedBox(height: 8),
|
||||
// --- SEZIONE OPERATIVA ---
|
||||
_buildHierarchicalItem(
|
||||
title: 'Operatività',
|
||||
icon: Icons.work_outline,
|
||||
basePathToCheck: '/',
|
||||
isCollapsed: effectivelyCollapsed,
|
||||
subItems: [
|
||||
_SubMenuItem(
|
||||
'Operazioni',
|
||||
Routes.operations,
|
||||
'/operations',
|
||||
),
|
||||
_SubMenuItem(
|
||||
'Assistenza',
|
||||
Routes.tickets,
|
||||
'/tickets',
|
||||
),
|
||||
_SubMenuItem('Tasks', Routes.tasks, '/tasks'),
|
||||
_SubMenuItem('Sticky Notes', Routes.notes, '/notes'),
|
||||
],
|
||||
),
|
||||
|
||||
const SizedBox(height: 8),
|
||||
|
||||
// --- IL MENU GERARCHICO (ANAGRAFICHE) ---
|
||||
@@ -256,7 +285,9 @@ class _AppMenuState extends State<AppMenu> {
|
||||
required bool isCollapsed,
|
||||
required List<_SubMenuItem> subItems,
|
||||
}) {
|
||||
final isSelected = widget.currentPath.startsWith(basePathToCheck);
|
||||
final isSelected = subItems.any(
|
||||
(item) => widget.currentPath.startsWith(item.pathToCheck),
|
||||
);
|
||||
final theme = Theme.of(context);
|
||||
|
||||
if (isCollapsed) {
|
||||
|
||||
Reference in New Issue
Block a user