-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from peercoin/v.0.1-1
V.0.1.1
- Loading branch information
Showing
10 changed files
with
187 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
import 'package:flutter/material.dart'; | ||
import 'package:intl/intl.dart'; | ||
import 'package:peercoin/models/availablecoins.dart'; | ||
import 'package:peercoin/models/coinwallet.dart'; | ||
import 'package:peercoin/models/wallettransaction.dart'; | ||
import 'package:url_launcher/url_launcher.dart'; | ||
|
||
class TransactionDetails extends StatelessWidget { | ||
static const routeName = "/tx-detail"; | ||
|
||
void _launchURL(_url) async { | ||
print(_url); | ||
await canLaunch(_url) ? await launch(_url) : throw 'Could not launch $_url'; | ||
} | ||
|
||
@override | ||
Widget build(BuildContext context) { | ||
final args = ModalRoute.of(context).settings.arguments as List; | ||
final WalletTransaction _tx = args[0]; | ||
final CoinWallet _coinWallet = args[1]; | ||
final String baseUrl = | ||
AvailableCoins().getSpecificCoin(_coinWallet.name).explorerTxDetailUrl; | ||
|
||
return Scaffold( | ||
appBar: AppBar( | ||
title: const Text( | ||
"Transaction details", | ||
)), | ||
body: ListView( | ||
padding: EdgeInsets.all(20), | ||
children: [ | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const Text("Id", style: TextStyle(fontWeight: FontWeight.bold)), | ||
SelectableText(_tx.txid) | ||
], | ||
), | ||
Divider(), | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const Text("Time", style: TextStyle(fontWeight: FontWeight.bold)), | ||
SelectableText(_tx.timestamp != null | ||
? DateFormat().format( | ||
DateTime.fromMillisecondsSinceEpoch(_tx.timestamp * 1000)) | ||
: "unconfirmed") | ||
], | ||
), | ||
Divider(), | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const Text( | ||
"Value", | ||
style: TextStyle(fontWeight: FontWeight.bold), | ||
), | ||
SelectableText((_tx.value / 1000000).toString() + | ||
" " + | ||
_coinWallet.letterCode) | ||
], | ||
), | ||
Divider(), | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const Text("Fee", style: TextStyle(fontWeight: FontWeight.bold)), | ||
SelectableText( | ||
(_tx.fee / 1000000).toString() + " " + _coinWallet.letterCode) | ||
], | ||
), | ||
Divider(), | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const Text("Address", | ||
style: TextStyle(fontWeight: FontWeight.bold)), | ||
SelectableText(_tx.address) | ||
], | ||
), | ||
Divider(), | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const Text("Direction", | ||
style: TextStyle(fontWeight: FontWeight.bold)), | ||
SelectableText(_tx.direction) | ||
], | ||
), | ||
Divider(), | ||
Column( | ||
crossAxisAlignment: CrossAxisAlignment.start, | ||
children: [ | ||
const Text("Confirmations", | ||
style: TextStyle(fontWeight: FontWeight.bold)), | ||
SelectableText(_tx.confirmations.toString()) | ||
], | ||
), | ||
Center( | ||
child: TextButton.icon( | ||
onPressed: () => _launchURL(baseUrl + "${_tx.txid}"), | ||
icon: Icon( | ||
Icons.search, | ||
color: Theme.of(context).primaryColor, | ||
), | ||
label: Text( | ||
"View in explorer", | ||
style: TextStyle(color: Theme.of(context).primaryColor), | ||
)), | ||
) | ||
], | ||
), | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters