diff --git a/lib/src/screens/transaction_details/transaction_details_page.dart b/lib/src/screens/transaction_details/transaction_details_page.dart index 7e9896fa2..b7406b41b 100644 --- a/lib/src/screens/transaction_details/transaction_details_page.dart +++ b/lib/src/screens/transaction_details/transaction_details_page.dart @@ -9,6 +9,7 @@ import 'package:cake_wallet/src/widgets/standart_list_row.dart'; import 'package:cake_wallet/src/screens/transaction_details/standart_list_item.dart'; import 'package:cake_wallet/src/screens/base_page.dart'; import 'package:cake_wallet/utils/date_formatter.dart'; +import 'package:url_launcher/url_launcher.dart'; class TransactionDetailsPage extends BasePage { TransactionDetailsPage(this.transactionInfo) : _items = [] { @@ -26,7 +27,10 @@ class TransactionDetailsPage extends BasePage { title: S.current.transaction_details_height, value: '${tx.height}'), StandartListItem( title: S.current.transaction_details_amount, - value: tx.amountFormatted()) + value: tx.amountFormatted()), + StandartListItem( + title: "View in Block Explorer", + value: "https://localmonero.co/blocks/search/${tx.id}"), ]; // FIXME // if (widget.settingsStore.shouldSaveRecipientAddress && @@ -57,7 +61,10 @@ class TransactionDetailsPage extends BasePage { title: S.current.transaction_details_height, value: '${tx.height}'), StandartListItem( title: S.current.transaction_details_amount, - value: tx.amountFormatted()) + value: tx.amountFormatted()), + StandartListItem( + title: "View in Block Explorer", + value: "https://www.blockchain.com/btc/tx/${tx.id}"), ]; _items.addAll(items); @@ -88,19 +95,31 @@ class TransactionDetailsPage extends BasePage { itemCount: _items.length, itemBuilder: (context, index) { final item = _items[index]; - final isDrawBottom = index == _items.length - 1 ? true : false; - - return GestureDetector( - onTap: () { - Clipboard.setData(ClipboardData(text: item.value)); - showBar(context, - S.of(context).transaction_details_copied(item.title)); - }, - child: StandartListRow( - title: '${item.title}:', - value: item.value, - isDrawBottom: isDrawBottom), - ); + final isFinalBlockExplorerItem = + index == _items.length - 1 ? true : false; + if (isFinalBlockExplorerItem == true) { + return GestureDetector( + onTap: () { + Clipboard.setData(ClipboardData(text: item.value)); + showBar(context, + S.of(context).transaction_details_copied(item.title)); + }, + child: StandartListRow( + title: '${item.title}:', + value: "", + isDrawBottom: isFinalBlockExplorerItem), + ); + } else { + return GestureDetector( + onTap: () { + launch(item.value); + }, + child: StandartListRow( + title: '${item.title}:', + value: item.value, + isDrawBottom: isFinalBlockExplorerItem), + ); + } }), ); } diff --git a/pubspec.lock b/pubspec.lock index ee3933bc8..8dc688fd7 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -140,7 +140,7 @@ packages: name: build_runner url: "https://pub.dartlang.org" source: hosted - version: "1.10.3" + version: "1.10.4" build_runner_core: dependency: transitive description: @@ -645,7 +645,7 @@ packages: name: path_provider url: "https://pub.dartlang.org" source: hosted - version: "1.6.21" + version: "1.6.22" path_provider_linux: dependency: transitive description: @@ -764,7 +764,7 @@ packages: name: quiver url: "https://pub.dartlang.org" source: hosted - version: "2.1.3" + version: "2.1.4+1" rxdart: dependency: "direct main" description: