mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-29 22:16:05 +00:00
Cw 199 add wallet deletion confirmation (#555)
* Fix Slidable for deleting wallet Add confirmation dialog for deleting wallet * Swap confirmation dialog buttons to be consistent with other alerts
This commit is contained in:
parent
d2b951f735
commit
c34c3b0737
16 changed files with 95 additions and 39 deletions
|
@ -156,22 +156,14 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
),
|
||||
));
|
||||
|
||||
// FIX-ME: Slidable for current
|
||||
return row;
|
||||
// return wallet.isCurrent
|
||||
// ? row
|
||||
// : Slidable(
|
||||
// key: Key('${wallet.key}'),
|
||||
// actionPane: SlidableDrawerActionPane(),
|
||||
// child: row,
|
||||
// secondaryActions: <Widget>[
|
||||
// IconSlideAction(
|
||||
// caption: S.of(context).delete,
|
||||
// color: Colors.red,
|
||||
// icon: CupertinoIcons.delete,
|
||||
// onTap: () async => _removeWallet(wallet),
|
||||
// )
|
||||
// ]);
|
||||
return wallet.isCurrent
|
||||
? row
|
||||
: Slidable(
|
||||
key: Key('${wallet.key}'),
|
||||
startActionPane: _actionPane(wallet),
|
||||
endActionPane: _actionPane(wallet),
|
||||
child: row,
|
||||
);
|
||||
}),
|
||||
),
|
||||
),
|
||||
|
@ -256,14 +248,34 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
auth.changeProcessText(
|
||||
S.of(context).wallet_list_removing_wallet(wallet.name));
|
||||
await widget.walletListViewModel.remove(wallet);
|
||||
} catch (e) {
|
||||
auth.changeProcessText(S
|
||||
.of(context)
|
||||
.wallet_list_failed_to_remove(wallet.name, e.toString()));
|
||||
bool confirmed = false;
|
||||
|
||||
await showPopUp<void>(
|
||||
context: context,
|
||||
builder: (BuildContext context) {
|
||||
return AlertWithTwoActions(
|
||||
alertTitle: S.of(context).delete_wallet,
|
||||
alertContent: S.of(context).delete_wallet_confirm_message(wallet.name),
|
||||
leftButtonText: S.of(context).cancel,
|
||||
rightButtonText: S.of(context).delete,
|
||||
actionLeftButton: () => Navigator.of(context).pop(),
|
||||
actionRightButton: () {
|
||||
confirmed = true;
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
);
|
||||
});
|
||||
|
||||
if (confirmed) {
|
||||
try {
|
||||
auth.changeProcessText(
|
||||
S.of(context).wallet_list_removing_wallet(wallet.name));
|
||||
await widget.walletListViewModel.remove(wallet);
|
||||
} catch (e) {
|
||||
auth.changeProcessText(S
|
||||
.of(context)
|
||||
.wallet_list_failed_to_remove(wallet.name, e.toString()));
|
||||
}
|
||||
}
|
||||
|
||||
auth.close();
|
||||
|
@ -279,4 +291,18 @@ class WalletListBodyState extends State<WalletListBody> {
|
|||
// _progressBar?.dismiss();
|
||||
// _progressBar = null;
|
||||
}
|
||||
|
||||
ActionPane _actionPane(WalletListItem wallet) => ActionPane(
|
||||
motion: const ScrollMotion(),
|
||||
extentRatio: 0.3,
|
||||
children: [
|
||||
SlidableAction(
|
||||
onPressed: (_) => _removeWallet(wallet),
|
||||
backgroundColor: Colors.red,
|
||||
foregroundColor: Colors.white,
|
||||
icon: CupertinoIcons.delete,
|
||||
label: S.of(context).delete,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
|
|
@ -643,5 +643,7 @@
|
|||
"choose_from_available_options": "Wähle aus verfügbaren Optionen:",
|
||||
"custom_redeem_amount": "Benutzerdefinierter Einlösungsbetrag",
|
||||
"add_custom_redemption": "Benutzerdefinierte Einlösung hinzufügen",
|
||||
"remaining": "Rest"
|
||||
"remaining": "Rest",
|
||||
"delete_wallet": "Geldbörse löschen",
|
||||
"delete_wallet_confirm_message" : "Sind Sie sicher, dass Sie das ${wallet_name} Wallet löschen möchten?"
|
||||
}
|
||||
|
|
|
@ -643,5 +643,7 @@
|
|||
"choose_from_available_options": "Choose from the available options:",
|
||||
"custom_redeem_amount": "Custom Redeem Amount",
|
||||
"add_custom_redemption": "Add Custom Redemption",
|
||||
"remaining": "remaining"
|
||||
"remaining": "remaining",
|
||||
"delete_wallet": "Delete wallet",
|
||||
"delete_wallet_confirm_message" : "Are you sure that you want to delete ${wallet_name} wallet?"
|
||||
}
|
||||
|
|
|
@ -643,5 +643,7 @@
|
|||
"choose_from_available_options": "Elija entre las opciones disponibles:",
|
||||
"custom_redeem_amount": "Cantidad de canje personalizada",
|
||||
"add_custom_redemption": "Agregar redención personalizada",
|
||||
"remaining": "restante"
|
||||
"remaining": "restante",
|
||||
"delete_wallet": "Eliminar billetera",
|
||||
"delete_wallet_confirm_message" : "¿Está seguro de que desea eliminar la billetera ${wallet_name}?"
|
||||
}
|
||||
|
|
|
@ -641,5 +641,7 @@
|
|||
"choose_from_available_options": "Choisissez parmi les options disponibles :",
|
||||
"custom_redeem_amount": "Montant d'échange personnalisé",
|
||||
"add_custom_redemption": "Ajouter un remboursement personnalisé",
|
||||
"remaining": "restant"
|
||||
"remaining": "restant",
|
||||
"delete_wallet": "Supprimer le portefeuille",
|
||||
"delete_wallet_confirm_message" : "Êtes-vous sûr de vouloir supprimer le portefeuille ${wallet_name}?"
|
||||
}
|
||||
|
|
|
@ -643,5 +643,7 @@
|
|||
"choose_from_available_options": "उपलब्ध विकल्पों में से चुनें:",
|
||||
"custom_redeem_amount": "कस्टम रिडीम राशि",
|
||||
"add_custom_redemption": "कस्टम रिडेम्पशन जोड़ें",
|
||||
"remaining": "शेष"
|
||||
"remaining": "शेष",
|
||||
"delete_wallet": "वॉलेट हटाएं",
|
||||
"delete_wallet_confirm_message" : "क्या आप वाकई ${wallet_name} वॉलेट हटाना चाहते हैं?"
|
||||
}
|
||||
|
|
|
@ -643,5 +643,7 @@
|
|||
"choose_from_available_options": "Odaberite neku od dostupnih opcija:",
|
||||
"custom_redeem_amount": "Prilagođeni iznos otkupa",
|
||||
"add_custom_redemption": "Dodaj prilagođeni otkup",
|
||||
"remaining": "preostalo"
|
||||
"remaining": "preostalo",
|
||||
"delete_wallet": "Izbriši novčanik",
|
||||
"delete_wallet_confirm_message" : "Jeste li sigurni da želite izbrisati ${wallet_name} novčanik?"
|
||||
}
|
||||
|
|
|
@ -643,5 +643,7 @@
|
|||
"choose_from_available_options": "Scegli tra le opzioni disponibili:",
|
||||
"custom_redeem_amount": "Importo di riscatto personalizzato",
|
||||
"add_custom_redemption": "Aggiungi riscatto personalizzato",
|
||||
"remaining": "rimanente"
|
||||
"remaining": "rimanente",
|
||||
"delete_wallet": "Elimina portafoglio",
|
||||
"delete_wallet_confirm_message" : "Sei sicuro di voler eliminare il portafoglio ${wallet_name}?"
|
||||
}
|
||||
|
|
|
@ -643,5 +643,7 @@
|
|||
"choose_from_available_options": "利用可能なオプションから選択してください:",
|
||||
"custom_redeem_amount": "カスタム交換金額",
|
||||
"add_custom_redemption": "カスタム引き換えを追加",
|
||||
"remaining": "残り"
|
||||
"remaining": "残り",
|
||||
"delete_wallet": "ウォレットを削除",
|
||||
"delete_wallet_confirm_message" : "${wallet_name} ウォレットを削除してもよろしいですか?"
|
||||
}
|
||||
|
|
|
@ -643,5 +643,7 @@
|
|||
"choose_from_available_options": "사용 가능한 옵션에서 선택:",
|
||||
"custom_redeem_amount": "사용자 지정 상환 금액",
|
||||
"add_custom_redemption": "사용자 지정 상환 추가",
|
||||
"remaining": "남은"
|
||||
"remaining": "남은",
|
||||
"delete_wallet": "지갑 삭제",
|
||||
"delete_wallet_confirm_message" : "${wallet_name} 지갑을 삭제하시겠습니까?"
|
||||
}
|
||||
|
|
|
@ -643,5 +643,7 @@
|
|||
"choose_from_available_options": "Kies uit de beschikbare opties:",
|
||||
"custom_redeem_amount": "Aangepast inwisselbedrag",
|
||||
"add_custom_redemption": "Voeg aangepaste inwisseling toe",
|
||||
"remaining": "resterende"
|
||||
"remaining": "resterende",
|
||||
"delete_wallet": "Portemonnee verwijderen",
|
||||
"delete_wallet_confirm_message" : "Weet u zeker dat u de portemonnee van ${wallet_name} wilt verwijderen?"
|
||||
}
|
||||
|
|
|
@ -643,5 +643,7 @@
|
|||
"choose_from_available_options": "Wybierz z dostępnych opcji:",
|
||||
"custom_redeem_amount": "Niestandardowa kwota wykorzystania",
|
||||
"add_custom_redemption": "Dodaj niestandardowe wykorzystanie",
|
||||
"remaining": "pozostałe"
|
||||
"remaining": "pozostałe",
|
||||
"delete_wallet": "Usuń portfel",
|
||||
"delete_wallet_confirm_message" : "Czy na pewno chcesz usunąć portfel ${wallet_name}?"
|
||||
}
|
||||
|
|
|
@ -643,5 +643,7 @@
|
|||
"choose_from_available_options": "Escolha entre as opções disponíveis:",
|
||||
"custom_redeem_amount": "Valor de resgate personalizado",
|
||||
"add_custom_redemption": "Adicionar resgate personalizado",
|
||||
"remaining": "restante"
|
||||
"remaining": "restante",
|
||||
"delete_wallet": "Excluir carteira",
|
||||
"delete_wallet_confirm_message" : "Tem certeza de que deseja excluir a carteira ${wallet_name}?"
|
||||
}
|
||||
|
|
|
@ -643,5 +643,7 @@
|
|||
"choose_from_available_options": "Выберите из доступных вариантов:",
|
||||
"custom_redeem_amount": "Пользовательская сумма погашения",
|
||||
"add_custom_redemption": "Добавить пользовательское погашение",
|
||||
"remaining": "осталось"
|
||||
"remaining": "осталось",
|
||||
"delete_wallet": "Удалить кошелек",
|
||||
"delete_wallet_confirm_message" : "Вы уверены, что хотите удалить кошелек ${wallet_name}?"
|
||||
}
|
||||
|
|
|
@ -642,5 +642,7 @@
|
|||
"choose_from_available_options": "Виберіть із доступних варіантів:",
|
||||
"custom_redeem_amount": "Власна сума викупу",
|
||||
"add_custom_redemption": "Додати спеціальне погашення",
|
||||
"remaining": "залишилося"
|
||||
"remaining": "залишилося",
|
||||
"delete_wallet": "Видалити гаманець",
|
||||
"delete_wallet_confirm_message" : "Ви впевнені, що хочете видалити гаманець ${wallet_name}?"
|
||||
}
|
||||
|
|
|
@ -641,5 +641,7 @@
|
|||
"choose_from_available_options": "从可用选项中选择:",
|
||||
"custom_redeem_amount": "自定义兑换金额",
|
||||
"add_custom_redemption": "添加自定义兑换",
|
||||
"remaining": "剩余"
|
||||
"remaining": "剩余",
|
||||
"delete_wallet": "删除钱包",
|
||||
"delete_wallet_confirm_message" : "您确定要删除 ${wallet_name} 钱包吗?"
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue