feat: ajout de la gestion de la préparation d'un événement avec page permettant de le gérer
This commit is contained in:
@@ -24,8 +24,22 @@ class _EquipmentConflictDialogState extends State<EquipmentConflictDialog> {
|
||||
.where((entry) => !_removedEquipmentIds.contains(entry.key))
|
||||
.fold(0, (sum, entry) => sum + entry.value.length);
|
||||
|
||||
/// Retourne l'icône appropriée selon le type de conflit
|
||||
IconData _getIconForConflict(AvailabilityConflict conflict) {
|
||||
switch (conflict.type) {
|
||||
case ConflictType.containerFullyUsed:
|
||||
case ConflictType.containerPartiallyUsed:
|
||||
return Icons.inventory_2;
|
||||
case ConflictType.insufficientQuantity:
|
||||
return Icons.production_quantity_limits;
|
||||
case ConflictType.equipmentUnavailable:
|
||||
return Icons.block;
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
|
||||
final dateFormat = DateFormat('dd/MM/yyyy');
|
||||
|
||||
return Dialog(
|
||||
@@ -117,19 +131,37 @@ class _EquipmentConflictDialogState extends State<EquipmentConflictDialog> {
|
||||
Row(
|
||||
children: [
|
||||
Icon(
|
||||
Icons.inventory_2,
|
||||
_getIconForConflict(firstConflict),
|
||||
color: isRemoved ? Colors.grey : AppColors.rouge,
|
||||
size: 20,
|
||||
),
|
||||
const SizedBox(width: 8),
|
||||
Expanded(
|
||||
child: Text(
|
||||
firstConflict.equipmentName,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
decoration: isRemoved ? TextDecoration.lineThrough : null,
|
||||
),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Text(
|
||||
firstConflict.equipmentName,
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 16,
|
||||
decoration: isRemoved ? TextDecoration.lineThrough : null,
|
||||
),
|
||||
),
|
||||
// Message de conflit spécifique
|
||||
if (firstConflict.conflictMessage.isNotEmpty)
|
||||
Padding(
|
||||
padding: const EdgeInsets.only(top: 4),
|
||||
child: Text(
|
||||
firstConflict.conflictMessage,
|
||||
style: TextStyle(
|
||||
fontSize: 13,
|
||||
color: Colors.orange.shade700,
|
||||
fontWeight: FontWeight.w500,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
if (isRemoved)
|
||||
|
||||
Reference in New Issue
Block a user