This commit is contained in:
Hanh 2023-03-01 23:10:07 +10:00
parent bd068ca94c
commit c6c5556688
7 changed files with 21 additions and 17 deletions

View File

@ -284,9 +284,9 @@ abstract class _ActiveAccount with Store {
return _sort(txs2, (Tx tx) => tx.txid, txSortConfig.order);
case "address":
return _sort(
txs2, (Tx tx) => tx.contact ?? tx.address, txSortConfig.order);
txs2, (Tx tx) => tx.contact ?? tx.address ?? '', txSortConfig.order);
case "memo":
return _sort(txs2, (Tx tx) => tx.memo, txSortConfig.order);
return _sort(txs2, (Tx tx) => tx.memo ?? '', txSortConfig.order);
}
return txs2;
}

View File

@ -40,9 +40,9 @@ class DbReader {
tx.shortTxId!,
tx.txId!,
tx.value / ZECUNIT,
tx.address!,
tx.name!.isNotEmpty ? tx.name! : null,
tx.memo!);
tx.address,
tx.name,
tx.memo);
}).toList();
print("TXS ${transactions.length}");
return transactions;

View File

@ -143,8 +143,8 @@ class HistoryDataSource extends DataTableSource {
final color = amountColor(context, tx.value);
var style = Theme.of(context).textTheme.bodyMedium!.copyWith(color: color);
style = weightFromAmount(style, tx.value);
final a = tx.contact ?? centerTrim(tx.address);
final m = tx.memo.substring(0, min(tx.memo.length, 32));
final a = tx.contact ?? centerTrim(tx.address ?? '');
final m = tx.memo?.substring(0, min(tx.memo!.length, 32)) ?? '';
return DataRow(
cells: [
@ -228,7 +228,7 @@ class TxItem extends StatelessWidget {
Text('${tx.txid}', style: theme.textTheme.labelSmall),
]),
Padding(padding: EdgeInsets.symmetric(horizontal: 4)),
Expanded(child: MessageContentWidget(tx.contact ?? tx.address, message, tx.memo)),
Expanded(child: MessageContentWidget(tx.contact ?? tx.address ?? '', message, tx.memo ?? '')),
SizedBox(
width: 100,
child: Column(children: [

View File

@ -1023,9 +1023,9 @@ class Tx extends HasHeight {
String txid;
String fullTxId;
double value;
String address;
String? address;
String? contact;
String memo;
String? memo;
Tx(this.id, this.height, this.timestamp, this.txid, this.fullTxId, this.value,
this.address, this.contact, this.memo);

@ -1 +1 @@
Subproject commit 12aa5328abdc1e1299c63113f9d21e7327180546
Subproject commit 078af89cae4d5e8a229aabb2bfa934e73e257094

View File

@ -1253,10 +1253,11 @@ packages:
qr_flutter:
dependency: "direct main"
description:
name: qr_flutter
sha256: c5c121c54cb6dd837b9b9d57eb7bc7ec6df4aee741032060c8833a678c80b87e
url: "https://pub.dev"
source: hosted
path: "."
ref: "4bdb1126e553b474b80c8c91e9f9e43baf1e9c4e"
resolved-ref: "4bdb1126e553b474b80c8c91e9f9e43baf1e9c4e"
url: "https://github.com/hhanh00/qr.flutter.git"
source: git
version: "4.0.0"
quick_actions:
dependency: "direct main"

View File

@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.3.4+386
version: 1.3.4+387
environment:
sdk: ">=2.12.0 <3.0.0"
@ -26,7 +26,10 @@ dependencies:
warp_api:
path: packages/warp_api_ffi
flutter_mobx: ^2.0.2
qr_flutter: ^4.0.0
qr_flutter:
git:
url: https://github.com/hhanh00/qr.flutter.git
ref: 4bdb1126e553b474b80c8c91e9f9e43baf1e9c4e
zxing2: ^0.1.1
http: ^0.13.3
intl: ^0.17.0