mandreshope 27863f800e style: Applies global theme and refines Reception page UI
Integrates `AppTheme` for consistent styling across the Reception page, affecting backgrounds, app bar, cards, and text.

Enhances `PrimaryButtonComponent` to support leading icons and centered content, and introduces `OutlineButtonComponent` for secondary actions, standardizing button usage.

Improves the AppBar by adding a drawer toggle and updating the title layout and styling. Removes the bottom navigation bar to streamline page navigation.
2025-07-24 09:05:43 +03:00

168 lines
5.9 KiB
Dart

import 'package:barcode_scanner/components/components.dart';
import 'package:barcode_scanner/components/drawer_component.dart';
import 'package:barcode_scanner/pages/operation/reception/reception_page_model.dart';
import 'package:barcode_scanner/themes/app_theme.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> {
final globalKey = GlobalKey<ScaffoldState>();
@override
void initState() {
super.initState();
SchedulerBinding.instance.addPostFrameCallback((_) {
ref.read(receptionPageModelProvider.notifier).getUserConnected();
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: AppTheme.of(context).primaryBackground,
key: globalKey,
drawer: DrawerComponent(isOperationExpanded: true),
appBar: AppBar(
leading: IconButton(
icon: Icon(Icons.menu, color: AppTheme.of(context).white),
onPressed: () {
globalKey.currentState?.openDrawer();
},
),
title: Row(
children: [
Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
"Réceptions",
style: AppTheme.of(
context,
).titleMedium.copyWith(color: AppTheme.of(context).white),
),
Text(
"Opérations d'Entrepôt",
style: AppTheme.of(
context,
).bodyMedium.copyWith(color: AppTheme.of(context).white),
),
],
),
],
),
toolbarHeight: 60,
backgroundColor: AppTheme.of(context).primary,
elevation: 4,
),
body: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),
child: ListView(
children: [
const SizedBox(height: 16),
Card(
elevation: 0,
color: AppTheme.of(context).secondaryBackground,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(color: AppTheme.of(context).alternate),
),
child: Padding(
padding: const EdgeInsets.all(16),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
'Actions Rapides',
style: AppTheme.of(
context,
).bodyMedium.copyWith(fontWeight: FontWeight.bold),
),
const Spacer(),
Container(
padding: const EdgeInsets.symmetric(
horizontal: 10,
vertical: 4,
),
decoration: BoxDecoration(
color: AppTheme.of(context).alternate,
borderRadius: BorderRadius.circular(20),
),
child: Text(
'3 en attente',
style: AppTheme.of(context).bodySmall,
),
),
],
),
const SizedBox(height: 16),
SizedBox(
width: double.maxFinite,
child: PrimaryButtonComponent(
centered: true,
leading: Icon(
Icons.add,
color: AppTheme.of(context).white,
),
text: 'Nouvelle Réception',
onPressed: () {},
),
),
const SizedBox(height: 12),
SizedBox(
width: double.maxFinite,
child: OutlineButtonComponent(
centered: true,
leading: const Icon(Icons.qr_code_scanner),
text: 'Scanner Code-Barres',
onPressed: () {},
),
),
const SizedBox(height: 12),
SizedBox(
width: double.maxFinite,
child: OutlineButtonComponent(
centered: true,
leading: const Icon(Icons.search),
text: 'Rechercher Existant',
onPressed: () {},
),
),
],
),
),
),
const SizedBox(height: 16),
Card(
color: AppTheme.of(context).secondaryBackground,
elevation: 0,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10),
side: BorderSide(color: AppTheme.of(context).alternate),
),
child: Padding(
padding: EdgeInsets.all(16),
child: Text(
'Activité Récente',
style: AppTheme.of(
context,
).bodyMedium.copyWith(fontWeight: FontWeight.bold),
),
),
),
],
),
),
);
}
}