Update transactions_page.dart

This commit is contained in:
Serhii 2024-05-08 16:53:39 +03:00
parent d8c1e14020
commit 0ee0b96247

View file

@ -89,22 +89,28 @@ class TransactionsPage extends StatelessWidget {
final transaction = item.transaction;
final historicalFiatValue = dashboardViewModel.getFormattedFiatAmount(transaction);
final formattedFiatValue = historicalFiatValue ??
item.formattedFiatAmount;
return Observer(
builder: (_) => TransactionRow(
return Observer(builder: (_) {
final historicalFiatValue =
dashboardViewModel.getFormattedFiatAmount(transaction);
final formattedFiatValue =
historicalFiatValue ?? item.formattedFiatAmount;
return TransactionRow(
onTap: () => Navigator.of(context)
.pushNamed(Routes.transactionDetails, arguments: transaction),
direction: transaction.direction,
formattedDate: DateFormat('HH:mm').format(transaction.date),
formattedAmount: item.formattedCryptoAmount,
formattedFiatAmount: dashboardViewModel.balanceViewModel.isFiatDisabled ? '' : formattedFiatValue,
formattedFiatAmount:
dashboardViewModel.balanceViewModel.isFiatDisabled
? ''
: formattedFiatValue,
isPending: transaction.isPending,
isHistoricalRate: dashboardViewModel.settingsStore.showHistoricalFiatAmount &&
historicalFiatValue !=null && historicalFiatValue.isNotEmpty,
title: item.formattedTitle + item.formattedStatus));
isHistoricalRate:
dashboardViewModel.settingsStore.showHistoricalFiatAmount &&
historicalFiatValue != null &&
historicalFiatValue.isNotEmpty,
title: item.formattedTitle + item.formattedStatus);
});
}
if (item is AnonpayTransactionListItem) {