2021-07-09 22:44:34 -07:00
|
|
|
import 'package:flutter/material.dart';
|
2021-07-10 22:20:53 -07:00
|
|
|
import 'package:url_launcher/url_launcher.dart';
|
2021-07-09 22:44:34 -07:00
|
|
|
|
2021-08-13 20:44:53 -07:00
|
|
|
import 'main.dart';
|
2021-07-09 22:44:34 -07:00
|
|
|
import 'store.dart';
|
2021-08-15 09:18:09 -07:00
|
|
|
import 'generated/l10n.dart';
|
2021-07-09 22:44:34 -07:00
|
|
|
|
|
|
|
class TransactionPage extends StatefulWidget {
|
|
|
|
final Tx tx;
|
|
|
|
|
|
|
|
TransactionPage(this.tx);
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<StatefulWidget> createState() => TransactionState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class TransactionState extends State<TransactionPage> {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
final textTheme = Theme.of(context).textTheme;
|
|
|
|
return Scaffold(
|
2021-08-15 09:18:09 -07:00
|
|
|
appBar: AppBar(title: Text(S.of(context).transactionDetails)),
|
2021-07-09 22:44:34 -07:00
|
|
|
body: ListView(padding: EdgeInsets.all(16), children: [
|
|
|
|
ListTile(
|
2021-08-18 23:10:14 -07:00
|
|
|
title: Text(S.of(context).txId), subtitle: SelectableText('${widget.tx.fullTxId}')),
|
2021-07-09 22:44:34 -07:00
|
|
|
ListTile(
|
2021-08-15 09:18:09 -07:00
|
|
|
title: Text(S.of(context).height), subtitle: SelectableText('${widget.tx.height}')),
|
2021-09-09 03:09:14 -07:00
|
|
|
ListTile(
|
|
|
|
title: Text(S.of(context).confs), subtitle: SelectableText('${syncStatus.latestHeight - widget.tx.height + 1}')),
|
2021-07-09 22:44:34 -07:00
|
|
|
ListTile(
|
2021-08-15 09:18:09 -07:00
|
|
|
title: Text(S.of(context).timestamp),
|
2021-07-09 22:44:34 -07:00
|
|
|
subtitle: Text('${widget.tx.timestamp}')),
|
2021-09-21 05:52:52 -07:00
|
|
|
ListTile(title: Text(S.of(context).amount), subtitle: SelectableText(decimalFormat(widget.tx.value, 8))),
|
2021-07-09 22:44:34 -07:00
|
|
|
ListTile(
|
2021-09-10 02:56:15 -07:00
|
|
|
title: Text(S.of(context).address), subtitle: SelectableText('${widget.tx.address}')),
|
2021-09-11 18:16:53 -07:00
|
|
|
ListTile(
|
|
|
|
title: Text(S.of(context).contactName), subtitle: SelectableText('${widget.tx.contact ?? "N/A"}')),
|
2021-09-10 02:56:15 -07:00
|
|
|
ListTile(title: Text(S.of(context).memo), subtitle: SelectableText('${widget.tx.memo}')),
|
2021-08-15 09:18:09 -07:00
|
|
|
ElevatedButton(onPressed: _onOpen, child: Text(S.of(context).openInExplorer))
|
2021-07-09 22:44:34 -07:00
|
|
|
]));
|
|
|
|
}
|
2021-07-10 22:20:53 -07:00
|
|
|
|
|
|
|
_onOpen() {
|
2021-08-13 20:44:53 -07:00
|
|
|
launch("${coin.explorerUrl}${widget.tx.fullTxId}");
|
2021-07-10 22:20:53 -07:00
|
|
|
}
|
2021-07-09 22:44:34 -07:00
|
|
|
}
|