This repository has been archived on 2024-11-18. You can view files and clone it, but cannot push or open issues or pull requests.
dialer/lib/features/Settings/key/delete_keyPair.dart

69 lines
1.8 KiB
Dart

// delete_keyPair.dart
import 'package:flutter/material.dart';
class SuppressionPaireClesPage extends StatelessWidget {
const SuppressionPaireClesPage({super.key});
void _deleteKeyPair(BuildContext context) {
// key deletion logic (not implemented here)
// ...
// Show confirmation message
ScaffoldMessenger.of(context).showSnackBar(
const SnackBar(
content: Text('La paire de clés a été supprimée.'),
),
);
// Navigate back or update the UI as needed
Navigator.pop(context);
}
void _showConfirmationDialog(BuildContext context) {
showDialog(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Confirmer la Suppression'),
content: const Text(
'Êtes-vous sûr de vouloir supprimer la paire de clés ? Cette action est irréversible.'),
actions: [
TextButton(
child: const Text('Annuler'),
onPressed: () {
Navigator.of(context).pop();
},
),
TextButton(
child: const Text('Supprimer'),
onPressed: () {
Navigator.of(context).pop();
_deleteKeyPair(context);
},
),
],
);
},
);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.black,
appBar: AppBar(
title: const Text('Suppression d\'une Paire de Clés'),
),
body: Center(
child: ElevatedButton(
onPressed: () {
_showConfirmationDialog(context);
},
child: const Text('Supprimer la Paire de Clés'),
),
),
);
}
}