Added popup for recipient deletion
This commit is contained in:
@@ -112,13 +112,33 @@ RouteBase payoutShellRoute() => ShellRoute(
|
|||||||
context,
|
context,
|
||||||
recipient: recipient,
|
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,
|
context: context,
|
||||||
action: () async =>
|
action: () async =>
|
||||||
context.read<RecipientsProvider>().delete(recipient.id),
|
context.read<RecipientsProvider>().delete(recipient.id),
|
||||||
successMessage: loc.recipientDeletedSuccessfully,
|
successMessage: loc.recipientDeletedSuccessfully,
|
||||||
errorMessage: loc.errorDeleteRecipient,
|
errorMessage: loc.errorDeleteRecipient,
|
||||||
),
|
);
|
||||||
|
},
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -346,6 +346,10 @@
|
|||||||
"@deletePaymentConfirmation": {
|
"@deletePaymentConfirmation": {
|
||||||
"description": "Confirmation dialog message shown before a payment method is removed"
|
"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": "Edit",
|
||||||
"@edit": {
|
"@edit": {
|
||||||
|
|||||||
@@ -346,6 +346,10 @@
|
|||||||
"@deletePaymentConfirmation": {
|
"@deletePaymentConfirmation": {
|
||||||
"description": "Сообщение диалога подтверждения, показываемое перед удалением способа оплаты"
|
"description": "Сообщение диалога подтверждения, показываемое перед удалением способа оплаты"
|
||||||
},
|
},
|
||||||
|
"deleteRecipientConfirmation": "Вы уверены, что хотите удалить получателя?",
|
||||||
|
"@deleteRecipientConfirmation": {
|
||||||
|
"description": "Сообщение диалога подтверждения, показываемое перед удалением получателя"
|
||||||
|
},
|
||||||
|
|
||||||
"edit": "Редактировать",
|
"edit": "Редактировать",
|
||||||
"@edit": {
|
"@edit": {
|
||||||
|
|||||||
Reference in New Issue
Block a user