
Removes the dedicated `HomePage` and its associated model files. Configures `ReceptionPage` as the new default landing page after successful login and product form submission. Updates navigation and state management dependencies to direct users to the primary operational interface upon entry.
167 lines
5.8 KiB
Dart
167 lines
5.8 KiB
Dart
import 'package:barcode_scanner/components/drawer_component.dart';
|
|
import 'package:barcode_scanner/pages/operation/reception/reception_page_model.dart';
|
|
import 'package:flutter/scheduler.dart';
|
|
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
import 'package:flutter/material.dart';
|
|
|
|
class ReceptionPage extends ConsumerStatefulWidget {
|
|
const ReceptionPage({super.key});
|
|
|
|
@override
|
|
ConsumerState<ReceptionPage> createState() => _ReceptionPageState();
|
|
}
|
|
|
|
class _ReceptionPageState extends ConsumerState<ReceptionPage> {
|
|
@override
|
|
void initState() {
|
|
super.initState();
|
|
SchedulerBinding.instance.addPostFrameCallback((_) {
|
|
ref.read(receptionPageModelProvider.notifier).getUserConnected();
|
|
});
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
drawer: DrawerComponent(isOperationExpanded: true),
|
|
appBar: AppBar(
|
|
title: const Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Text("Gestionnaire d'Inventaire", style: TextStyle(fontSize: 18)),
|
|
Text("Opérations d'Entrepôt", style: TextStyle(fontSize: 12)),
|
|
],
|
|
),
|
|
toolbarHeight: 60,
|
|
backgroundColor: Colors.blue,
|
|
elevation: 4,
|
|
),
|
|
body: Padding(
|
|
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
|
|
child: ListView(
|
|
children: [
|
|
Row(
|
|
children: [
|
|
const Icon(Icons.arrow_back),
|
|
const SizedBox(width: 8),
|
|
const Text(
|
|
'Réceptions',
|
|
style: TextStyle(fontSize: 18, fontWeight: FontWeight.bold),
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 16),
|
|
Card(
|
|
elevation: 0,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(10),
|
|
side: BorderSide(color: Colors.grey.shade300),
|
|
),
|
|
child: Padding(
|
|
padding: const EdgeInsets.all(16),
|
|
child: Column(
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
children: [
|
|
Row(
|
|
children: [
|
|
const Text(
|
|
'Actions Rapides',
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
fontWeight: FontWeight.bold,
|
|
),
|
|
),
|
|
const Spacer(),
|
|
Container(
|
|
padding: const EdgeInsets.symmetric(
|
|
horizontal: 10,
|
|
vertical: 4,
|
|
),
|
|
decoration: BoxDecoration(
|
|
color: Colors.grey.shade200,
|
|
borderRadius: BorderRadius.circular(20),
|
|
),
|
|
child: const Text(
|
|
'3 en attente',
|
|
style: TextStyle(fontSize: 12),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
const SizedBox(height: 16),
|
|
ElevatedButton.icon(
|
|
icon: const Icon(Icons.add),
|
|
label: const Text('Nouvelle Réception'),
|
|
onPressed: () {},
|
|
style: ElevatedButton.styleFrom(
|
|
minimumSize: const Size.fromHeight(50),
|
|
),
|
|
),
|
|
const SizedBox(height: 12),
|
|
OutlinedButton.icon(
|
|
icon: const Icon(Icons.qr_code_scanner),
|
|
label: const Text('Scanner Code-Barres'),
|
|
onPressed: () {},
|
|
style: OutlinedButton.styleFrom(
|
|
minimumSize: const Size.fromHeight(50),
|
|
),
|
|
),
|
|
const SizedBox(height: 12),
|
|
OutlinedButton.icon(
|
|
icon: const Icon(Icons.search),
|
|
label: const Text('Rechercher Existant'),
|
|
onPressed: () {},
|
|
style: OutlinedButton.styleFrom(
|
|
minimumSize: const Size.fromHeight(50),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
),
|
|
const SizedBox(height: 16),
|
|
Card(
|
|
elevation: 0,
|
|
shape: RoundedRectangleBorder(
|
|
borderRadius: BorderRadius.circular(10),
|
|
side: BorderSide(color: Colors.grey.shade300),
|
|
),
|
|
child: const Padding(
|
|
padding: EdgeInsets.all(16),
|
|
child: Text(
|
|
'Activité Récente',
|
|
style: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
|
|
),
|
|
),
|
|
),
|
|
],
|
|
),
|
|
),
|
|
bottomNavigationBar: BottomNavigationBar(
|
|
currentIndex: 1, // Opérations sélectionné
|
|
selectedItemColor: Colors.blue,
|
|
unselectedItemColor: Colors.grey,
|
|
items: const [
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.home_outlined),
|
|
label: 'Accueil',
|
|
),
|
|
BottomNavigationBarItem(icon: Icon(Icons.inbox), label: 'Opérations'),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.insert_chart),
|
|
label: 'Produits',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.history),
|
|
label: 'Historique',
|
|
),
|
|
BottomNavigationBarItem(
|
|
icon: Icon(Icons.settings),
|
|
label: 'Paramètres',
|
|
),
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|