Added popup for recipient deletion #293
@@ -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,
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
@@ -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": {
|
||||
|
||||
@@ -346,6 +346,10 @@
|
||||
"@deletePaymentConfirmation": {
|
||||
"description": "Сообщение диалога подтверждения, показываемое перед удалением способа оплаты"
|
||||
},
|
||||
"deleteRecipientConfirmation": "Вы уверены, что хотите удалить получателя?",
|
||||
"@deleteRecipientConfirmation": {
|
||||
"description": "Сообщение диалога подтверждения, показываемое перед удалением получателя"
|
||||
},
|
||||
|
||||
"edit": "Редактировать",
|
||||
"@edit": {
|
||||
|
||||
Reference in New Issue
Block a user