feat: add current events section for equipment with dynamic status calculation

This commit is contained in:
ElPoyo
2026-01-06 12:13:09 +01:00
parent 25d395b41a
commit fb6a271f66
12 changed files with 773 additions and 124 deletions

View File

@@ -87,40 +87,45 @@ class _EventPreparationButtonsState extends State<EventPreparationButtons> {
children: [
// Bouton de l'étape actuelle
if (!isCompleted)
ElevatedButton.icon(
onPressed: () async {
final result = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => EventPreparationPage(
initialEvent: event,
Center(
child: ConstrainedBox(
constraints: const BoxConstraints(maxWidth: 400),
child: ElevatedButton.icon(
onPressed: () async {
final result = await Navigator.push(
context,
MaterialPageRoute(
builder: (context) => EventPreparationPage(
initialEvent: event,
),
),
);
// Si la validation a réussi, le StreamBuilder se rechargera automatiquement
if (result == true && context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Étape validée avec succès'),
backgroundColor: Colors.green,
),
);
}
},
icon: Icon(buttonIcon),
label: Text(
buttonText,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
);
// Si la validation a réussi, le StreamBuilder se rechargera automatiquement
if (result == true && context.mounted) {
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('Étape validée avec succès'),
backgroundColor: Colors.green,
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.bleuFonce,
padding: const EdgeInsets.symmetric(vertical: 12, horizontal: 24),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
);
}
},
icon: Icon(buttonIcon),
label: Text(
buttonText,
style: const TextStyle(
fontSize: 16,
fontWeight: FontWeight.bold,
),
),
style: ElevatedButton.styleFrom(
backgroundColor: AppColors.bleuFonce,
padding: const EdgeInsets.symmetric(vertical: 12),
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(8),
),
),
),
),