import 'package:flutter/material.dart'; import 'clients_screen.dart'; import 'recompenses_screen.dart'; import 'reglages_screen.dart'; import 'scan_screen.dart'; /// Coquille principale : 4 onglets + barre de navigation. class HomeShell extends StatefulWidget { const HomeShell({super.key}); @override State createState() => _HomeShellState(); } class _HomeShellState extends State { int _index = 0; void _allerScanner() => setState(() => _index = 1); @override Widget build(BuildContext context) { final pages = [ ClientsScreen(onAllerScanner: _allerScanner), ScanScreen(active: _index == 1), const RecompensesScreen(), const ReglagesScreen(), ]; 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.people_alt_outlined), selectedIcon: Icon(Icons.people_alt), label: 'Clients', ), NavigationDestination( icon: Icon(Icons.qr_code_scanner_outlined), selectedIcon: Icon(Icons.qr_code_scanner), label: 'Scanner', ), NavigationDestination( icon: Icon(Icons.card_giftcard_outlined), selectedIcon: Icon(Icons.card_giftcard), label: 'Récompenses', ), NavigationDestination( icon: Icon(Icons.settings_outlined), selectedIcon: Icon(Icons.settings), label: 'Réglages', ), ], ), ); } }