Skip to content

Commit

Permalink
WALLET TX - tx amount and icon fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mocodesmo committed Dec 24, 2024
1 parent f76f14a commit 487c8e0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions lib/wallet/wallet_txs.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -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: () {
Expand All @@ -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),
),
),
Expand Down

0 comments on commit 487c8e0

Please sign in to comment.