Déplace les panels/wizards/validation/common partagés hors de widgets/admin/ ; ne conserve que AdminManagementWidget (variante A). Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
990 B
Dart
33 lines
990 B
Dart
import 'package:flutter/material.dart';
|
||
import 'validation_modal_theme.dart';
|
||
|
||
/// Affiche une confirmation avant d’appeler l’API de validation du dossier.
|
||
/// Retourne `true` si l’utilisateur confirme.
|
||
Future<bool> showValidationValiderConfirmDialog(
|
||
BuildContext context, {
|
||
required String body,
|
||
}) async {
|
||
final result = await showDialog<bool>(
|
||
context: context,
|
||
barrierDismissible: false,
|
||
builder: (dialogContext) {
|
||
return AlertDialog(
|
||
title: const Text('Confirmer la validation'),
|
||
content: Text(body),
|
||
actions: [
|
||
TextButton(
|
||
onPressed: () => Navigator.of(dialogContext).pop(false),
|
||
child: const Text('Annuler'),
|
||
),
|
||
ElevatedButton(
|
||
style: ValidationModalTheme.primaryElevatedStyle,
|
||
onPressed: () => Navigator.of(dialogContext).pop(true),
|
||
child: const Text('Confirmer'),
|
||
),
|
||
],
|
||
);
|
||
},
|
||
);
|
||
return result == true;
|
||
}
|