From 487c8e04177eb5c3efc56d71e09be7b7e0589110 Mon Sep 17 00:00:00 2001 From: mocodesmo Date: Wed, 25 Dec 2024 00:44:19 +0530 Subject: [PATCH] WALLET TX - tx amount and icon fix --- lib/wallet/wallet_txs.dart | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/lib/wallet/wallet_txs.dart b/lib/wallet/wallet_txs.dart index 462f0f49..4fcd3ae6 100644 --- a/lib/wallet/wallet_txs.dart +++ b/lib/wallet/wallet_txs.dart @@ -135,14 +135,17 @@ class HomeTxItem extends StatelessWidget { @override Widget build(BuildContext context) { final label = tx.label ?? ''; + final isReceive = tx.isReceived(); - final amount = context.select( + var amount = context.select( (CurrencyCubit x) => x.state.getAmountInUnits( tx.getNetAmountIncludingFees(), isLiquid: tx.isLiquid, ), ); + amount = '${isReceive ? '' : ''}${amount.replaceAll("-", "")}'; + // final amt = '${isReceive ? '' : ''}${amount.replaceAll("-", "")}'; final darkMode = context.select( @@ -152,6 +155,8 @@ class HomeTxItem extends StatelessWidget { // final isChainSwap = tx.isSwap && tx.swapTx!.isChainSwap(); const imgBaseName = 'assets/images/arrow_down'; final img = darkMode ? '${imgBaseName}_white.png' : '$imgBaseName.png'; + final isChainSwap = tx.isSwap && tx.swapTx!.isChainSwap(); + final isChainReceive = isChainSwap && tx.swapTx!.isChainReceive(); return InkWell( onTap: () { @@ -173,7 +178,10 @@ class HomeTxItem extends StatelessWidget { // color: Colors.red, transformAlignment: Alignment.center, transform: Matrix4.identity() - ..rotateZ(tx.getNetAmountToPayee() > 0 ? 0 : 3.16), + ..rotateZ( + // tx.getNetAmountToPayee() > 0 + isReceive || isChainReceive ? 0 : 3.16, + ), child: Image.asset(img), ), ),