62 lines
1.9 KiB
Dart
62 lines
1.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import '../../../../core/constants/colors.dart';
|
|
|
|
class AccountDeletionCard extends StatelessWidget {
|
|
final BuildContext context;
|
|
|
|
const AccountDeletionCard({Key? key, required this.context}) : super(key: key);
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Card(
|
|
color: AppColors.cardColor,
|
|
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
|
|
elevation: 2,
|
|
child: ListTile(
|
|
leading: const Icon(Icons.delete, color: Colors.redAccent),
|
|
title: const Text(
|
|
'Supprimer le compte',
|
|
style: TextStyle(color: Colors.redAccent, fontWeight: FontWeight.bold),
|
|
),
|
|
onTap: () => _showDeleteConfirmationDialog(),
|
|
),
|
|
);
|
|
}
|
|
|
|
void _showDeleteConfirmationDialog() {
|
|
showDialog(
|
|
context: context,
|
|
builder: (BuildContext context) {
|
|
return AlertDialog(
|
|
backgroundColor: AppColors.backgroundColor,
|
|
title: const Text(
|
|
'Confirmer la suppression',
|
|
style: TextStyle(color: Colors.white),
|
|
),
|
|
content: const Text(
|
|
'Êtes-vous sûr de vouloir supprimer votre compte ? Cette action est irréversible.',
|
|
style: TextStyle(color: Colors.white70),
|
|
),
|
|
actions: [
|
|
TextButton(
|
|
onPressed: () => Navigator.of(context).pop(),
|
|
child: Text('Annuler', style: TextStyle(color: AppColors.accentColor)),
|
|
),
|
|
TextButton(
|
|
onPressed: () {
|
|
print("[LOG] Suppression du compte confirmée.");
|
|
Navigator.of(context).pop();
|
|
// Logique de suppression du compte
|
|
},
|
|
child: const Text(
|
|
'Supprimer',
|
|
style: TextStyle(color: Colors.redAccent),
|
|
),
|
|
),
|
|
],
|
|
);
|
|
},
|
|
);
|
|
}
|
|
}
|