4d936d2ee3
App Flutter de gestion de stock/prix pour tablette Android (100% local) : scan code-barres (OpenFoodFacts), prix au kilo/litre, packs, inventaire, prix d'achat + marge, filtres de tri, étiquettes PDF, design noir & blanc. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
53 lines
1.5 KiB
Dart
53 lines
1.5 KiB
Dart
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<HomeShell> createState() => _HomeShellState();
|
|
}
|
|
|
|
class _HomeShellState extends State<HomeShell> {
|
|
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',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|