mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-02-03 03:36:39 +00:00
revised bugs in transaction details screen
This commit is contained in:
parent
20b5951d38
commit
558c6fff22
1 changed files with 19 additions and 7 deletions
|
@ -15,6 +15,19 @@ import 'package:url_launcher/url_launcher.dart';
|
||||||
|
|
||||||
import 'package:hive/hive.dart';
|
import 'package:hive/hive.dart';
|
||||||
|
|
||||||
|
String stripURLToTXID(String inputString) {
|
||||||
|
final RegExp txidRegex = new RegExp('[a-z0-9]{64}');
|
||||||
|
return txidRegex.allMatches(inputString).first.group(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
String blockExplorerName(String inputName) {
|
||||||
|
if (inputName.contains("xmrchain")) {
|
||||||
|
return "XMRChain.net";
|
||||||
|
} else {
|
||||||
|
return "Blockchain.com";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
class TransactionDetailsPage extends BasePage {
|
class TransactionDetailsPage extends BasePage {
|
||||||
TransactionDetailsPage(this.transactionInfo, bool showRecipientAddress,
|
TransactionDetailsPage(this.transactionInfo, bool showRecipientAddress,
|
||||||
Box<TransactionDescription> transactionDescriptionBox)
|
Box<TransactionDescription> transactionDescriptionBox)
|
||||||
|
@ -34,12 +47,8 @@ class TransactionDetailsPage extends BasePage {
|
||||||
StandartListItem(
|
StandartListItem(
|
||||||
title: S.current.transaction_details_amount,
|
title: S.current.transaction_details_amount,
|
||||||
value: tx.amountFormatted()),
|
value: tx.amountFormatted()),
|
||||||
StandartListItem(title: S.current.send_fee, value: tx.feeFormatted()),
|
StandartListItem(title: S.current.send_fee, value: tx.feeFormatted())
|
||||||
StandartListItem(
|
|
||||||
title: "View in Block Explorer",
|
|
||||||
value: "https://xmrchain.net/search?value=${tx.id}")
|
|
||||||
];
|
];
|
||||||
|
|
||||||
if (showRecipientAddress) {
|
if (showRecipientAddress) {
|
||||||
final recipientAddress = transactionDescriptionBox.values
|
final recipientAddress = transactionDescriptionBox.values
|
||||||
.firstWhere((val) => val.id == transactionInfo.id,
|
.firstWhere((val) => val.id == transactionInfo.id,
|
||||||
|
@ -52,9 +61,11 @@ class TransactionDetailsPage extends BasePage {
|
||||||
value: recipientAddress));
|
value: recipientAddress));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
items.add(StandartListItem(
|
||||||
|
title: "View in Block Explorer",
|
||||||
|
value: "https://xmrchain.net/search?value=${tx.id}"));
|
||||||
|
|
||||||
if (tx.key?.isNotEmpty ?? null) {
|
if (tx.key?.isNotEmpty ?? null) {
|
||||||
// FIXME: add translation
|
|
||||||
items.add(StandartListItem(title: 'Transaction Key', value: tx.key));
|
items.add(StandartListItem(title: 'Transaction Key', value: tx.key));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -129,7 +140,8 @@ class TransactionDetailsPage extends BasePage {
|
||||||
},
|
},
|
||||||
child: StandartListRow(
|
child: StandartListRow(
|
||||||
title: '${item.title}:',
|
title: '${item.title}:',
|
||||||
value: item.value,
|
value:
|
||||||
|
"View transaction on ${blockExplorerName(item.value)}",
|
||||||
isDrawBottom: isFinalBlockExplorerItem),
|
isDrawBottom: isFinalBlockExplorerItem),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue