Cw-58: Show subaddress label on the transaction details page (#333)

* CW-58: Show subaddress label on the transaction details page

* add translations

* Fix interface
This commit is contained in:
clear
2022-04-12 16:38:47 +01:00
committed by GitHub
parent 04db28e276
commit 135ede6a78
23 changed files with 69 additions and 13 deletions
+5
View File
@@ -294,4 +294,9 @@ class CWMonero extends Monero {
final moneroWallet = wallet as MoneroWallet;
return moneroWallet.getTransactionAddress(accountIndex, addressIndex);
}
String getSubaddressLabel(Object wallet, int accountIndex, int addressIndex) {
final moneroWallet = wallet as MoneroWallet;
return moneroWallet.getSubaddressLabel(accountIndex, addressIndex);
}
}
@@ -60,6 +60,7 @@ abstract class TransactionDetailsViewModelBase with Store {
addressIndex != null) {
try {
final address = monero.getTransactionAddress(wallet, accountIndex, addressIndex);
final label = monero.getSubaddressLabel(wallet, accountIndex, addressIndex);
if (address?.isNotEmpty ?? false) {
isRecipientAddressShown = true;
@@ -68,6 +69,14 @@ abstract class TransactionDetailsViewModelBase with Store {
title: S.current.transaction_details_recipient_address,
value: address));
}
if (label?.isNotEmpty ?? false) {
_items.add(
StandartListItem(
title: S.current.address_label,
value: label)
);
}
} catch (e) {
print(e.toString());
}