67 lines
1.7 KiB
Dart
67 lines
1.7 KiB
Dart
import 'package:flutter/material.dart';
|
|
|
|
class DeleteKeyPairPage extends StatelessWidget {
|
|
const DeleteKeyPairPage({super.key});
|
|
|
|
void _deleteKeyPair(BuildContext context) {
|
|
// Key deletion logic (not implemented here)
|
|
// ...
|
|
|
|
// Show confirmation message
|
|
ScaffoldMessenger.of(context).showSnackBar(
|
|
const SnackBar(
|
|
content: Text('The key pair has been deleted.'),
|
|
),
|
|
);
|
|
|
|
// 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('Confirm Deletion'),
|
|
content: const Text(
|
|
'Are you sure you want to delete the key pair? This action is irreversible.'),
|
|
actions: [
|
|
TextButton(
|
|
child: const Text('Cancel'),
|
|
onPressed: () {
|
|
Navigator.of(context).pop();
|
|
},
|
|
),
|
|
TextButton(
|
|
child: const Text('Delete'),
|
|
onPressed: () {
|
|
Navigator.of(context).pop();
|
|
_deleteKeyPair(context);
|
|
},
|
|
),
|
|
],
|
|
);
|
|
},
|
|
);
|
|
}
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Scaffold(
|
|
backgroundColor: Colors.black,
|
|
appBar: AppBar(
|
|
title: const Text('Delete a Key Pair'),
|
|
),
|
|
body: Center(
|
|
child: ElevatedButton(
|
|
onPressed: () {
|
|
_showConfirmationDialog(context);
|
|
},
|
|
child: const Text('Delete Key Pair'),
|
|
),
|
|
),
|
|
);
|
|
}
|
|
}
|