Added popup for recipient deletion #293

Merged
tech merged 1 commits from SEND032 into main 2026-01-21 15:51:47 +00:00
3 changed files with 30 additions and 2 deletions

View File

@@ -112,13 +112,33 @@ RouteBase payoutShellRoute() => ShellRoute(
context,
recipient: recipient,
),
onDeleteRecipient: (recipient) => executeActionWithNotification(
onDeleteRecipient: (recipient) async {
final confirmed = await showDialog<bool>(
context: context,
builder: (dialogContext) => AlertDialog(
title: Text(loc.delete),
content: Text(loc.deleteRecipientConfirmation),
actions: [
TextButton(
onPressed: () => Navigator.pop(dialogContext, false),
child: Text(loc.cancel),
),
ElevatedButton(
onPressed: () => Navigator.pop(dialogContext, true),
child: Text(loc.delete),
),
],
),
);
if (confirmed != true) return;
await executeActionWithNotification(
context: context,
action: () async =>
context.read<RecipientsProvider>().delete(recipient.id),
successMessage: loc.recipientDeletedSuccessfully,
errorMessage: loc.errorDeleteRecipient,
),
);
},
),
);
},

View File

@@ -346,6 +346,10 @@
"@deletePaymentConfirmation": {
"description": "Confirmation dialog message shown before a payment method is removed"
},
"deleteRecipientConfirmation": "Are you sure you want to delete this recipient?",
"@deleteRecipientConfirmation": {
"description": "Confirmation dialog message shown before a recipient is removed"
},
"edit": "Edit",
"@edit": {

View File

@@ -346,6 +346,10 @@
"@deletePaymentConfirmation": {
"description": "Сообщение диалога подтверждения, показываемое перед удалением способа оплаты"
},
"deleteRecipientConfirmation": "Вы уверены, что хотите удалить получателя?",
"@deleteRecipientConfirmation": {
"description": "Сообщение диалога подтверждения, показываемое перед удалением получателя"
},
"edit": "Редактировать",
"@edit": {