Improve history view; WIP
This commit is contained in:
parent
2d136f89cf
commit
45aa28ab70
|
@ -22,7 +22,7 @@ List parseHistory(txs) {
|
||||||
transBC[i] = [];
|
transBC[i] = [];
|
||||||
final dateBrut =
|
final dateBrut =
|
||||||
DateTime.fromMillisecondsSinceEpoch(transaction['writtenTime'] * 1000);
|
DateTime.fromMillisecondsSinceEpoch(transaction['writtenTime'] * 1000);
|
||||||
final DateFormat formatter = DateFormat('dd-MM-yy - HH:mm');
|
final DateFormat formatter = DateFormat('dd-MM-yy\nHH:mm');
|
||||||
final date = formatter.format(dateBrut);
|
final date = formatter.format(dateBrut);
|
||||||
transBC[i].add(transaction['writtenTime']);
|
transBC[i].add(transaction['writtenTime']);
|
||||||
transBC[i].add(date);
|
transBC[i].add(date);
|
||||||
|
@ -33,15 +33,14 @@ List parseHistory(txs) {
|
||||||
final int applyBase = base - currentBase;
|
final int applyBase = base - currentBase;
|
||||||
final num amount = removeDecimalZero(amountBrut * pow(10, applyBase) / 100);
|
final num amount = removeDecimalZero(amountBrut * pow(10, applyBase) / 100);
|
||||||
num amountUD = amount / currentUD;
|
num amountUD = amount / currentUD;
|
||||||
int padNbr = 14 - amount.toString().length;
|
|
||||||
if (direction == "RECEIVED") {
|
if (direction == "RECEIVED") {
|
||||||
transBC[i].add(transaction['issuers'][0]);
|
transBC[i].add(transaction['issuers'][0]);
|
||||||
transBC[i].add(' ' + amount.toString().padRight(padNbr));
|
transBC[i].add(amount.toString());
|
||||||
transBC[i].add(amountUD.toStringAsFixed(2));
|
transBC[i].add(amountUD.toStringAsFixed(2));
|
||||||
} else if (direction == "SENT") {
|
} else if (direction == "SENT") {
|
||||||
final outPubkey = output.split("SIG(")[1].replaceAll(')', '');
|
final outPubkey = output.split("SIG(")[1].replaceAll(')', '');
|
||||||
transBC[i].add(outPubkey);
|
transBC[i].add(outPubkey);
|
||||||
transBC[i].add(' -' + amount.toString().padRight(padNbr - 1));
|
transBC[i].add(amount.toString());
|
||||||
transBC[i].add(amountUD.toStringAsFixed(2));
|
transBC[i].add(amountUD.toStringAsFixed(2));
|
||||||
}
|
}
|
||||||
transBC[i].add(transaction['comment']);
|
transBC[i].add(transaction['comment']);
|
||||||
|
|
|
@ -155,29 +155,47 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
SizedBox(height: 7),
|
SizedBox(height: 7),
|
||||||
if (_historyProvider.pubkey != '')
|
if (_historyProvider.pubkey != '')
|
||||||
Text(balance.toString() + ' Ğ1',
|
Row(
|
||||||
textAlign: TextAlign.center,
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
style: TextStyle(fontSize: 30.0)),
|
children: [
|
||||||
|
Container(width: 32.0, height: 0.0),
|
||||||
|
Text(balance.toString() + ' Ğ1',
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
style: TextStyle(fontSize: 30.0)),
|
||||||
|
Container(
|
||||||
|
padding: const EdgeInsets.only(right: 80),
|
||||||
|
child: Text("Payer")),
|
||||||
|
]),
|
||||||
SizedBox(height: 12),
|
SizedBox(height: 12),
|
||||||
for (var repository in _transBC)
|
for (var repository in _transBC)
|
||||||
ListTile(
|
Padding(
|
||||||
contentPadding: const EdgeInsets.all(5.0),
|
padding: const EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
leading: Text(repository[3],
|
child: ListTile(
|
||||||
style: TextStyle(fontSize: 14.0)),
|
contentPadding: const EdgeInsets.all(5.0),
|
||||||
title: Text(
|
leading: Text(repository[1].toString(),
|
||||||
repository[1].toString() +
|
style: TextStyle(
|
||||||
'\n' +
|
fontSize: 12,
|
||||||
truncate(repository[2], 17,
|
color: Colors.grey[800],
|
||||||
|
fontWeight: FontWeight.w700),
|
||||||
|
textAlign: TextAlign.center),
|
||||||
|
title: Text(repository[5],
|
||||||
|
style: TextStyle(fontSize: 14.0),
|
||||||
|
textAlign: TextAlign.center),
|
||||||
|
subtitle: Text(
|
||||||
|
truncate(repository[2], 20,
|
||||||
omission: "...",
|
omission: "...",
|
||||||
position: TruncatePosition.end),
|
position: TruncatePosition.end),
|
||||||
style: TextStyle(fontSize: 14.0)),
|
style: TextStyle(fontSize: 11.0),
|
||||||
subtitle: Text(repository[5],
|
textAlign: TextAlign.center),
|
||||||
style: TextStyle(fontSize: 14.0)),
|
trailing: Text("${repository[3]} Ğ1",
|
||||||
dense: true,
|
style: TextStyle(fontSize: 14.0),
|
||||||
onTap: () {
|
textAlign: TextAlign.justify),
|
||||||
// this._outputPubkey.text = repository[2];
|
dense: true,
|
||||||
_historyProvider.isPubkey(repository[2]);
|
isThreeLine: false,
|
||||||
}),
|
onTap: () {
|
||||||
|
// this._outputPubkey.text = repository[2];
|
||||||
|
_historyProvider.isPubkey(repository[2]);
|
||||||
|
})),
|
||||||
if (result.isLoading)
|
if (result.isLoading)
|
||||||
Row(
|
Row(
|
||||||
mainAxisAlignment: MainAxisAlignment.center,
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
@ -198,7 +216,7 @@ class HistoryScreen extends StatelessWidget with ChangeNotifier {
|
||||||
onNotification: (t) {
|
onNotification: (t) {
|
||||||
if (t is ScrollEndNotification &&
|
if (t is ScrollEndNotification &&
|
||||||
scrollController.position.pixels >=
|
scrollController.position.pixels >=
|
||||||
scrollController.position.maxScrollExtent * 0.8) {
|
scrollController.position.maxScrollExtent * 0.7) {
|
||||||
fetchMore(opts);
|
fetchMore(opts);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Reference in New Issue