feat: Ajout de la gestion des maintenances et intégration de la synthèse vocale
This commit is contained in:
@@ -8,12 +8,14 @@ class EquipmentMaintenanceHistorySection extends StatelessWidget {
|
||||
final List<MaintenanceModel> maintenances;
|
||||
final bool isLoading;
|
||||
final bool hasManagePermission;
|
||||
final VoidCallback? onAddMaintenance;
|
||||
|
||||
const EquipmentMaintenanceHistorySection({
|
||||
super.key,
|
||||
required this.maintenances,
|
||||
required this.isLoading,
|
||||
required this.hasManagePermission,
|
||||
this.onAddMaintenance,
|
||||
});
|
||||
|
||||
@override
|
||||
@@ -37,19 +39,42 @@ class EquipmentMaintenanceHistorySection extends StatelessWidget {
|
||||
),
|
||||
),
|
||||
),
|
||||
if (hasManagePermission && onAddMaintenance != null)
|
||||
IconButton(
|
||||
icon: const Icon(Icons.add_circle, color: AppColors.bleuFonce),
|
||||
tooltip: 'Planifier une maintenance',
|
||||
onPressed: onAddMaintenance,
|
||||
),
|
||||
],
|
||||
),
|
||||
const Divider(height: 24),
|
||||
if (isLoading)
|
||||
const Center(child: CircularProgressIndicator())
|
||||
else if (maintenances.isEmpty)
|
||||
const Padding(
|
||||
padding: EdgeInsets.all(16.0),
|
||||
child: Center(
|
||||
child: Text(
|
||||
'Aucune maintenance enregistrée',
|
||||
style: TextStyle(color: Colors.grey),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(16.0),
|
||||
child: Column(
|
||||
children: [
|
||||
const Center(
|
||||
child: Text(
|
||||
'Aucune maintenance enregistrée',
|
||||
style: TextStyle(color: Colors.grey),
|
||||
),
|
||||
),
|
||||
if (hasManagePermission && onAddMaintenance != null) ...[
|
||||
const SizedBox(height: 16),
|
||||
Center(
|
||||
child: ElevatedButton.icon(
|
||||
onPressed: onAddMaintenance,
|
||||
icon: const Icon(Icons.add),
|
||||
label: const Text('Planifier une maintenance'),
|
||||
style: ElevatedButton.styleFrom(
|
||||
backgroundColor: AppColors.bleuFonce,
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
],
|
||||
),
|
||||
)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user