What changed, and why it matters
This commit is a routine UI polish: it adds bottom padding to a transaction history list and renames an internal counter from 'enabledProviders' to 'enabledProvidersCount' to make the code clearer. There is no security change.
No security action required; treat as a normal UI refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff wraps a SliverList in a SliverPadding with a conditional bottom padding of 144 logical pixels, and renames the computed MobX getter enabledProviders to enabledProvidersCount across four call sites. No logic, validation, cryptography, networking, or permission behavior is modified.
Changed components
lib/new-ui/widgets/coins_page/assets_history/history_section.dartlib/new-ui/widgets/coins_page/assets_history/history_filters_page.dartlib/new-ui/widgets/coins_page/assets_history/history_swap_providers_page.dartlib/store/dashboard/trade_filter_store.dartlib/view_model/dashboard/dashboard_view_model.dartInspect captured patch +152 / −149
diff --git a/lib/new-ui/widgets/coins_page/assets_history/history_filters_page.dart b/lib/new-ui/widgets/coins_page/assets_history/history_filters_page.dart
index 072f1101..a42edeb6 100644
--- a/lib/new-ui/widgets/coins_page/assets_history/history_filters_page.dart
+++ b/lib/new-ui/widgets/coins_page/assets_history/history_filters_page.dart
@@ -55,7 +55,7 @@ class HistoryFiltersPage extends StatelessWidget {
if (dashboardViewModel.tradeFilterStore.displayAllTrades) {
subtitle = S.of(context).manage_providers;
subtitleColor = Theme.of(context).colorScheme.onSurfaceVariant;
- } else if (dashboardViewModel.tradeFilterStore.enabledProviders == 0) {
+ } else if (dashboardViewModel.tradeFilterStore.enabledProvidersCount == 0) {
subtitle = S.of(context).no_providers_selected;
subtitleColor = Color(0xFFFFB84E);
} else {
@@ -74,10 +74,10 @@ class HistoryFiltersPage extends StatelessWidget {
value: item.value(),
onChanged: (val) {
if ((val &&
- dashboardViewModel.tradeFilterStore.enabledProviders ==
+ dashboardViewModel.tradeFilterStore.enabledProvidersCount ==
0) ||
(!val &&
- dashboardViewModel.tradeFilterStore.enabledProviders >
+ dashboardViewModel.tradeFilterStore.enabledProvidersCount >
0)) {
dashboardViewModel.tradeFilterStore
.toggleDisplayExchange(ExchangeProviderDescription.all);
diff --git a/lib/new-ui/widgets/coins_page/assets_history/history_section.dart b/lib/new-ui/widgets/coins_page/assets_history/history_section.dart
index 2bdd715a..f6bab448 100644
--- a/lib/new-ui/widgets/coins_page/assets_history/history_section.dart
+++ b/lib/new-ui/widgets/coins_page/assets_history/history_section.dart
@@ -56,153 +56,156 @@ class HistorySection extends StatelessWidget {
),
),
)
- : SliverList(
- delegate: SliverChildBuilderDelegate(
- childCount: items.length,
- (context, index) => Observer(builder: (_) {
- final prevItem = index == 0 ? null : items[index - 1];
- final topPadding = index == 0 ? 0.0 : 18.0;
- final item = items[index];
- final nextItem = index == items.length - 1
- ? null
- : items[index + 1];
-
- final roundedBottom = (nextItem == null || nextItem is DateSectionItem);
- final roundedTop = roundedTopSection && (prevItem == null || prevItem is DateSectionItem);
-
- if (item is TransactionListItem) {
- final transaction = item.transaction;
- final transactionType = dashboardViewModel.getTransactionType(transaction);
-
- if (item.hasTokens && item.assetOfTransaction == null) {
- return Container();
- }
-
- CryptoCurrency? asset;
- if (transaction.additionalInfo["isLightning"] == true)
- asset = CryptoCurrency.btcln;
- else
- asset = item.assetOfTransaction;
-
- return GestureDetector(
- onTap: () {
- final page = getIt.get<TransactionDetailsModal>(param1: transaction);
- if (detailsAsPage) {
- Navigator.of(context).push(
- CupertinoPageRoute(builder: (context) => Material(child: page)));
- } else {
- showModalBottomSheet(
- isScrollControlled: true,
- context: context,
- builder: (context) =>
- FractionallySizedBox(heightFactor: 0.9, child: page));
- }
- },
- child: HistoryTile(
- title: item.formattedTitle + transactionType,
- date: _formatTransactionDate(item.date, localeName),
- amount: item.formattedCryptoAmount,
- amountFiat: item.formattedFiatAmount,
- hasTokens: item.hasTokens,
- chainIconPath: _getChainIconPath(),
- roundedBottom: roundedBottom,
- roundedTop: roundedTop,
- bottomSeparator: !roundedBottom,
- direction: item.transaction.direction,
- pending: item.transaction.isPending,
- asset: asset,
- ),
- );
- } else if (item is TradeListItem) {
- final trade = item.trade;
- final tradeFrom = trade.from;
- final tradeTo = trade.to;
-
- return GestureDetector(
- onTap: () => Navigator.of(context)
- .pushNamed(Routes.tradeDetails, arguments: trade),
- child: HistoryTradeTile(
- from: tradeFrom,
- to: tradeTo,
- provider: trade.provider,
- date: _formatTransactionDate(item.trade.createdAt ?? DateTime.now(), localeName),
- amount: dashboardViewModel.balanceDisplayMode == BalanceDisplayMode.hiddenBalance ? "---" : trade.amountFormatted(),
- receiveAmount: dashboardViewModel.balanceDisplayMode == BalanceDisplayMode.hiddenBalance ? "---" : trade.receiveAmountFormatted(),
- roundedBottom: roundedBottom,
- roundedTop: roundedTop,
- bottomSeparator: !roundedBottom,
- swapState: trade.state,
- ),
- );
- } else if (item is SpecificDateSectionItem) {
- return Padding(
- padding: EdgeInsets.only(left: 8.0, bottom: 8.0, top: topPadding),
- child: Text(item.text,
- style: TextStyle(
- color: Theme.of(context).colorScheme.onSurfaceVariant)));
- } else if (item is DateSectionItem) {
- return Padding(
- padding: EdgeInsets.only(left: 8.0, bottom: 8.0, top: topPadding),
- child: Text(DateFormat("MMMM yyyy", localeName).format(item.date),
- style: TextStyle(
- color: Theme.of(context).colorScheme.onSurfaceVariant)));
- } else if (item is OrderListItem) {
- return GestureDetector(
- onTap: () => Navigator.of(context)
- .pushNamed(Routes.orderDetails, arguments: item.order),
- child: HistoryOrderTile(
- date: _formatTransactionDate(item.order.createdAt, localeName),
- amount: item.orderFormattedAmount,
- amountFiat: "",
- roundedBottom: roundedBottom,
- roundedTop: roundedTop,
- bottomSeparator: !roundedBottom,
- ),
- );
- } else if (item is PayjoinTransactionListItem) {
- final session = item.session;
-
- return GestureDetector(
- onTap: () => Navigator.of(context).pushNamed(
- Routes.payjoinDetails,
- arguments: [item.sessionId, item.transaction],
- ),
- child: PayjoinHistoryTile(
- createdAt: _formatTransactionDate(session.inProgressSince!, localeName),
- amount: dashboardViewModel.appStore.amountParsingProxy
- .asDisplayString(Money(
- session.amount, CryptoCurrency.btc)),
- currency: item.transaction?.from ?? "BTC",
- state: item.status,
- isSending: session.isSenderSession,
+ : SliverPadding(
+ padding: EdgeInsets.only(bottom: short ? 0 : 144),
+ sliver: SliverList(
+ delegate: SliverChildBuilderDelegate(
+ childCount: items.length,
+ (context, index) => Observer(builder: (_) {
+ final prevItem = index == 0 ? null : items[index - 1];
+ final topPadding = index == 0 ? 0.0 : 18.0;
+ final item = items[index];
+ final nextItem = index == items.length - 1
+ ? null
+ : items[index + 1];
+
+ final roundedBottom = (nextItem == null || nextItem is DateSectionItem);
+ final roundedTop = roundedTopSection && (prevItem == null || prevItem is DateSectionItem);
+
+ if (item is TransactionListItem) {
+ final transaction = item.transaction;
+ final transactionType = dashboardViewModel.getTransactionType(transaction);
+
+ if (item.hasTokens && item.assetOfTransaction == null) {
+ return Container();
+ }
+
+ CryptoCurrency? asset;
+ if (transaction.additionalInfo["isLightning"] == true)
+ asset = CryptoCurrency.btcln;
+ else
+ asset = item.assetOfTransaction;
+
+ return GestureDetector(
+ onTap: () {
+ final page = getIt.get<TransactionDetailsModal>(param1: transaction);
+ if (detailsAsPage) {
+ Navigator.of(context).push(
+ CupertinoPageRoute(builder: (context) => Material(child: page)));
+ } else {
+ showModalBottomSheet(
+ isScrollControlled: true,
+ context: context,
+ builder: (context) =>
+ FractionallySizedBox(heightFactor: 0.9, child: page));
+ }
+ },
+ child: HistoryTile(
+ title: item.formattedTitle + transactionType,
+ date: _formatTransactionDate(item.date, localeName),
+ amount: item.formattedCryptoAmount,
+ amountFiat: item.formattedFiatAmount,
+ hasTokens: item.hasTokens,
+ chainIconPath: _getChainIconPath(),
+ roundedBottom: roundedBottom,
roundedTop: roundedTop,
+ bottomSeparator: !roundedBottom,
+ direction: item.transaction.direction,
+ pending: item.transaction.isPending,
+ asset: asset,
+ ),
+ );
+ } else if (item is TradeListItem) {
+ final trade = item.trade;
+ final tradeFrom = trade.from;
+ final tradeTo = trade.to;
+
+ return GestureDetector(
+ onTap: () => Navigator.of(context)
+ .pushNamed(Routes.tradeDetails, arguments: trade),
+ child: HistoryTradeTile(
+ from: tradeFrom,
+ to: tradeTo,
+ provider: trade.provider,
+ date: _formatTransactionDate(item.trade.createdAt ?? DateTime.now(), localeName),
+ amount: dashboardViewModel.balanceDisplayMode == BalanceDisplayMode.hiddenBalance ? "---" : trade.amountFormatted(),
+ receiveAmount: dashboardViewModel.balanceDisplayMode == BalanceDisplayMode.hiddenBalance ? "---" : trade.receiveAmountFormatted(),
roundedBottom: roundedBottom,
- bottomSeparator: !roundedBottom),
- );
- } else if (item is AnonpayTransactionListItem) {
- final transactionInfo = item.transaction;
-
- return GestureDetector(
+ roundedTop: roundedTop,
+ bottomSeparator: !roundedBottom,
+ swapState: trade.state,
+ ),
+ );
+ } else if (item is SpecificDateSectionItem) {
+ return Padding(
+ padding: EdgeInsets.only(left: 8.0, bottom: 8.0, top: topPadding),
+ child: Text(item.text,
+ style: TextStyle(
+ color: Theme.of(context).colorScheme.onSurfaceVariant)));
+ } else if (item is DateSectionItem) {
+ return Padding(
+ padding: EdgeInsets.only(left: 8.0, bottom: 8.0, top: topPadding),
+ child: Text(DateFormat("MMMM yyyy", localeName).format(item.date),
+ style: TextStyle(
+ color: Theme.of(context).colorScheme.onSurfaceVariant)));
+ } else if (item is OrderListItem) {
+ return GestureDetector(
onTap: () => Navigator.of(context)
- .pushNamed(Routes.anonPayDetailsPage, arguments: transactionInfo),
- child: AnonpayHistoryTile(
- provider: transactionInfo.provider,
- createdAt: _formatTransactionDate(transactionInfo.createdAt, localeName),
- amount: transactionInfo.fiatAmount?.toString() ??
- (transactionInfo.amountTo?.toString() ?? ''),
- currency: transactionInfo.fiatAmount != null
- ? transactionInfo.fiatEquiv ?? ''
- : CryptoCurrency.fromFullName(transactionInfo.coinTo)
- .name
- .toUpperCase(),
+ .pushNamed(Routes.orderDetails, arguments: item.order),
+ child: HistoryOrderTile(
+ date: _formatTransactionDate(item.order.createdAt, localeName),
+ amount: item.orderFormattedAmount,
+ amountFiat: "",
+ roundedBottom: roundedBottom,
+ roundedTop: roundedTop,
+ bottomSeparator: !roundedBottom,
+ ),
+ );
+ } else if (item is PayjoinTransactionListItem) {
+ final session = item.session;
+
+ return GestureDetector(
+ onTap: () => Navigator.of(context).pushNamed(
+ Routes.payjoinDetails,
+ arguments: [item.sessionId, item.transaction],
+ ),
+ child: PayjoinHistoryTile(
+ createdAt: _formatTransactionDate(session.inProgressSince!, localeName),
+ amount: dashboardViewModel.appStore.amountParsingProxy
+ .asDisplayString(Money(
+ session.amount, CryptoCurrency.btc)),
+ currency: item.transaction?.from ?? "BTC",
+ state: item.status,
+ isSending: session.isSenderSession,
roundedTop: roundedTop,
roundedBottom: roundedBottom,
- bottomSeparator: !roundedBottom));
- } else
- return Text(item.runtimeType.toString());
- }),
+ bottomSeparator: !roundedBottom),
+ );
+ } else if (item is AnonpayTransactionListItem) {
+ final transactionInfo = item.transaction;
+
+ return GestureDetector(
+ onTap: () => Navigator.of(context)
+ .pushNamed(Routes.anonPayDetailsPage, arguments: transactionInfo),
+ child: AnonpayHistoryTile(
+ provider: transactionInfo.provider,
+ createdAt: _formatTransactionDate(transactionInfo.createdAt, localeName),
+ amount: transactionInfo.fiatAmount?.toString() ??
+ (transactionInfo.amountTo?.toString() ?? ''),
+ currency: transactionInfo.fiatAmount != null
+ ? transactionInfo.fiatEquiv ?? ''
+ : CryptoCurrency.fromFullName(transactionInfo.coinTo)
+ .name
+ .toUpperCase(),
+ roundedTop: roundedTop,
+ roundedBottom: roundedBottom,
+ bottomSeparator: !roundedBottom));
+ } else
+ return Text(item.runtimeType.toString());
+ }),
+ ),
),
- );
+ );
},
));
}
diff --git a/lib/new-ui/widgets/coins_page/assets_history/history_swap_providers_page.dart b/lib/new-ui/widgets/coins_page/assets_history/history_swap_providers_page.dart
index 1010e4c4..46de3fb3 100644
--- a/lib/new-ui/widgets/coins_page/assets_history/history_swap_providers_page.dart
+++ b/lib/new-ui/widgets/coins_page/assets_history/history_swap_providers_page.dart
@@ -42,9 +42,9 @@ class HistorySwapProvidersPage extends StatelessWidget {
title: S.of(context).swap_providers,
onSelected: (val) {
if ((val &&
- dashboardViewModel.tradeFilterStore.enabledProviders == 0) ||
+ dashboardViewModel.tradeFilterStore.enabledProvidersCount == 0) ||
(!val &&
- dashboardViewModel.tradeFilterStore.enabledProviders > 0)) {
+ dashboardViewModel.tradeFilterStore.enabledProvidersCount > 0)) {
dashboardViewModel.tradeFilterStore
.toggleDisplayExchange(ExchangeProviderDescription.all);
}
diff --git a/lib/store/dashboard/trade_filter_store.dart b/lib/store/dashboard/trade_filter_store.dart
index 2fee9cc7..57e3149e 100644
--- a/lib/store/dashboard/trade_filter_store.dart
+++ b/lib/store/dashboard/trade_filter_store.dart
@@ -70,7 +70,7 @@ abstract class TradeFilterStoreBase with Store {
bool displayNearIntents;
@computed
- int get enabledProviders => [
+ int get enabledProvidersCount => [
displayChangeNow,
displaySideShift,
displaySimpleSwap,
diff --git a/lib/view_model/dashboard/dashboard_view_model.dart b/lib/view_model/dashboard/dashboard_view_model.dart
index 8bdb6d4e..77c59b76 100644
--- a/lib/view_model/dashboard/dashboard_view_model.dart
+++ b/lib/view_model/dashboard/dashboard_view_model.dart
@@ -274,9 +274,9 @@ abstract class DashboardViewModelBase with Store {
onChanged: transactionFilterStore.toggleSilentPayments,
),
SwapFilterItem(
- enabledProviders: () => tradeFilterStore.enabledProviders,
+ enabledProviders: () => tradeFilterStore.enabledProvidersCount,
allEnabled: () => tradeFilterStore.displayAllTrades,
- value: () => tradeFilterStore.enabledProviders>0,
+ value: () => tradeFilterStore.enabledProvidersCount>0,
onChanged: () =>
tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.all)),
FilterItem(
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.