Files
app_fideliter/lib/screens/home_shell.dart
T
Mathew 1d3ee69c6d Initial commit — app fidélité magasin (tablette)
App Flutter de programme de fidélité : login staff, clients (nom/prénom),
scan QR, factures (€→points), récompenses, réglages. Backend Supabase
(schéma SQL + RLS anti-triche dans supabase/). Icône incluse.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-17 21:37:06 +02:00

62 lines
1.8 KiB
Dart

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<HomeShell> createState() => _HomeShellState();
}
class _HomeShellState extends State<HomeShell> {
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',
),
],
),
);
}
}