feat(loans): confirm declared material state changes
This commit is contained in:
@@ -9,8 +9,6 @@ import "../widgets/brand_corners.dart";
|
||||
import "../widgets/etat_checklist.dart";
|
||||
import "confirmation_screen.dart";
|
||||
|
||||
/// Checklist de départ (RG11) : l'étudiant indique l'état de chaque accessoire
|
||||
/// attendu avant de confirmer l'emprunt.
|
||||
class ChecklistDepartScreen extends StatefulWidget {
|
||||
const ChecklistDepartScreen({super.key, required this.item});
|
||||
|
||||
@@ -31,6 +29,8 @@ class _ChecklistDepartScreenState extends State<ChecklistDepartScreen> {
|
||||
final TextEditingController _commentaireController = TextEditingController();
|
||||
bool _envoiEnCours = false;
|
||||
|
||||
bool get _ecartDeclare => _etats.any((etat) => etat != EtatChecklist.present);
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
_commentaireController.dispose();
|
||||
@@ -240,12 +240,45 @@ class _ChecklistDepartScreenState extends State<ChecklistDepartScreen> {
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
ChecklistInstructions(
|
||||
titre: "Instructions",
|
||||
titre: "État de référence",
|
||||
texte:
|
||||
"Vérifiez physiquement chaque élément du kit et indiquez son état : "
|
||||
"Présent, Absent ou Détérioré. Signalez tout élément manquant ou "
|
||||
"endommagé pour éviter tout litige au retour.",
|
||||
"Tous les éléments sont préremplis comme présents. Vérifiez-les "
|
||||
"physiquement et modifiez uniquement ceux qui sont absents ou détériorés.",
|
||||
),
|
||||
if (_ecartDeclare) ...[
|
||||
const SizedBox(height: 14),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
padding: const EdgeInsets.all(14),
|
||||
decoration: BoxDecoration(
|
||||
color: const Color(0xFFFFF7ED),
|
||||
borderRadius: BorderRadius.circular(8),
|
||||
border: Border.all(color: const Color(0xFFFED7AA)),
|
||||
),
|
||||
child: Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
const Icon(
|
||||
Icons.warning_amber_rounded,
|
||||
color: Color(0xFFD97706),
|
||||
size: 20,
|
||||
),
|
||||
const SizedBox(width: 10),
|
||||
Expanded(
|
||||
child: Text(
|
||||
"Cet écart sera transmis au responsable. L'emprunt restera "
|
||||
"en attente jusqu'à sa confirmation.",
|
||||
style: GoogleFonts.titilliumWeb(
|
||||
fontSize: 13,
|
||||
color: EnsupColors.text2,
|
||||
height: 1.4,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
const SizedBox(height: 14),
|
||||
ChecklistCommentaire(controller: _commentaireController),
|
||||
const SizedBox(height: 14),
|
||||
@@ -266,7 +299,9 @@ class _ChecklistDepartScreenState extends State<ChecklistDepartScreen> {
|
||||
label: Text(
|
||||
_envoiEnCours
|
||||
? "Enregistrement..."
|
||||
: "Valider la checklist et confirmer l'emprunt",
|
||||
: _ecartDeclare
|
||||
? "Signaler l'écart"
|
||||
: "Confirmer l'emprunt",
|
||||
textAlign: TextAlign.center,
|
||||
style: GoogleFonts.darkerGrotesque(
|
||||
fontWeight: FontWeight.w700,
|
||||
|
||||
Reference in New Issue
Block a user