import 'package:flutter/material.dart'; import 'etiquettes_screen.dart'; import 'produits_screen.dart'; import 'scan_screen.dart'; /// Coquille principale : contient les 3 onglets et la barre de navigation. class HomeShell extends StatefulWidget { const HomeShell({super.key}); @override State createState() => _HomeShellState(); } class _HomeShellState extends State { int _index = 0; @override Widget build(BuildContext context) { final pages = [ ProduitsScreen(onAllerScanner: () => setState(() => _index = 1)), ScanScreen(active: _index == 1), const EtiquettesScreen(), ]; return Scaffold( body: IndexedStack(index: _index, children: pages), bottomNavigationBar: NavigationBar( selectedIndex: _index, height: 68, labelBehavior: NavigationDestinationLabelBehavior.alwaysShow, onDestinationSelected: (i) => setState(() => _index = i), destinations: const [ NavigationDestination( icon: Icon(Icons.inventory_2_outlined), selectedIcon: Icon(Icons.inventory_2), label: 'Produits', ), NavigationDestination( icon: Icon(Icons.qr_code_scanner_outlined), selectedIcon: Icon(Icons.qr_code_scanner), label: 'Scanner', ), NavigationDestination( icon: Icon(Icons.print_outlined), selectedIcon: Icon(Icons.print), label: 'Étiquettes', ), ], ), ); } }