add padding

Robert Malikowski committed Jul 13, 2026 at 15:54 UTC 90cbf6777a3da8090c8e368d050279ff7cedf827
5 files changed +152 -149
lib/new-ui/widgets/coins_page/assets_history/history_filters_page.dart
+3 -3
@@ -55,7 +55,7 @@ class HistoryFiltersPage extends StatelessWidget {
55 if (dashboardViewModel.tradeFilterStore.displayAllTrades) {
56 subtitle = S.of(context).manage_providers;
57 subtitleColor = Theme.of(context).colorScheme.onSurfaceVariant;
58 - } else if (dashboardViewModel.tradeFilterStore.enabledProviders == 0) {
58 + } else if (dashboardViewModel.tradeFilterStore.enabledProvidersCount == 0) {
59 subtitle = S.of(context).no_providers_selected;
60 subtitleColor = Color(0xFFFFB84E);
61 } else {
@@ -74,10 +74,10 @@ class HistoryFiltersPage extends StatelessWidget {
74 value: item.value(),
75 onChanged: (val) {
76 if ((val &&
77 - dashboardViewModel.tradeFilterStore.enabledProviders ==
77 + dashboardViewModel.tradeFilterStore.enabledProvidersCount ==
78 0) ||
79 (!val &&
80 - dashboardViewModel.tradeFilterStore.enabledProviders >
80 + dashboardViewModel.tradeFilterStore.enabledProvidersCount >
81 0)) {
82 dashboardViewModel.tradeFilterStore
83 .toggleDisplayExchange(ExchangeProviderDescription.all);
lib/new-ui/widgets/coins_page/assets_history/history_section.dart
+144 -141
@@ -56,153 +56,156 @@ class HistorySection extends StatelessWidget {
56 ),
57 ),
58 )
59 - : SliverList(
60 - delegate: SliverChildBuilderDelegate(
61 - childCount: items.length,
62 - (context, index) => Observer(builder: (_) {
63 - final prevItem = index == 0 ? null : items[index - 1];
64 - final topPadding = index == 0 ? 0.0 : 18.0;
65 - final item = items[index];
66 - final nextItem = index == items.length - 1
67 - ? null
68 - : items[index + 1];
69 -
70 - final roundedBottom = (nextItem == null || nextItem is DateSectionItem);
71 - final roundedTop = roundedTopSection && (prevItem == null || prevItem is DateSectionItem);
72 -
73 - if (item is TransactionListItem) {
74 - final transaction = item.transaction;
75 - final transactionType = dashboardViewModel.getTransactionType(transaction);
76 -
77 - if (item.hasTokens && item.assetOfTransaction == null) {
78 - return Container();
79 - }
80 -
81 - CryptoCurrency? asset;
82 - if (transaction.additionalInfo["isLightning"] == true)
83 - asset = CryptoCurrency.btcln;
84 - else
85 - asset = item.assetOfTransaction;
86 -
87 - return GestureDetector(
88 - onTap: () {
89 - final page = getIt.get<TransactionDetailsModal>(param1: transaction);
90 - if (detailsAsPage) {
91 - Navigator.of(context).push(
92 - CupertinoPageRoute(builder: (context) => Material(child: page)));
93 - } else {
94 - showModalBottomSheet(
95 - isScrollControlled: true,
96 - context: context,
97 - builder: (context) =>
98 - FractionallySizedBox(heightFactor: 0.9, child: page));
99 - }
100 - },
101 - child: HistoryTile(
102 - title: item.formattedTitle + transactionType,
103 - date: _formatTransactionDate(item.date, localeName),
104 - amount: item.formattedCryptoAmount,
105 - amountFiat: item.formattedFiatAmount,
106 - hasTokens: item.hasTokens,
107 - chainIconPath: _getChainIconPath(),
108 - roundedBottom: roundedBottom,
109 - roundedTop: roundedTop,
110 - bottomSeparator: !roundedBottom,
111 - direction: item.transaction.direction,
112 - pending: item.transaction.isPending,
113 - asset: asset,
114 - ),
115 - );
116 - } else if (item is TradeListItem) {
117 - final trade = item.trade;
118 - final tradeFrom = trade.from;
119 - final tradeTo = trade.to;
120 -
121 - return GestureDetector(
122 - onTap: () => Navigator.of(context)
123 - .pushNamed(Routes.tradeDetails, arguments: trade),
124 - child: HistoryTradeTile(
125 - from: tradeFrom,
126 - to: tradeTo,
127 - provider: trade.provider,
128 - date: _formatTransactionDate(item.trade.createdAt ?? DateTime.now(), localeName),
129 - amount: dashboardViewModel.balanceDisplayMode == BalanceDisplayMode.hiddenBalance ? "---" : trade.amountFormatted(),
130 - receiveAmount: dashboardViewModel.balanceDisplayMode == BalanceDisplayMode.hiddenBalance ? "---" : trade.receiveAmountFormatted(),
131 - roundedBottom: roundedBottom,
132 - roundedTop: roundedTop,
133 - bottomSeparator: !roundedBottom,
134 - swapState: trade.state,
135 - ),
136 - );
137 - } else if (item is SpecificDateSectionItem) {
138 - return Padding(
139 - padding: EdgeInsets.only(left: 8.0, bottom: 8.0, top: topPadding),
140 - child: Text(item.text,
141 - style: TextStyle(
142 - color: Theme.of(context).colorScheme.onSurfaceVariant)));
143 - } else if (item is DateSectionItem) {
144 - return Padding(
145 - padding: EdgeInsets.only(left: 8.0, bottom: 8.0, top: topPadding),
146 - child: Text(DateFormat("MMMM yyyy", localeName).format(item.date),
147 - style: TextStyle(
148 - color: Theme.of(context).colorScheme.onSurfaceVariant)));
149 - } else if (item is OrderListItem) {
150 - return GestureDetector(
151 - onTap: () => Navigator.of(context)
152 - .pushNamed(Routes.orderDetails, arguments: item.order),
153 - child: HistoryOrderTile(
154 - date: _formatTransactionDate(item.order.createdAt, localeName),
155 - amount: item.orderFormattedAmount,
156 - amountFiat: "",
157 - roundedBottom: roundedBottom,
158 - roundedTop: roundedTop,
159 - bottomSeparator: !roundedBottom,
160 - ),
161 - );
162 - } else if (item is PayjoinTransactionListItem) {
163 - final session = item.session;
164 -
165 - return GestureDetector(
166 - onTap: () => Navigator.of(context).pushNamed(
167 - Routes.payjoinDetails,
168 - arguments: [item.sessionId, item.transaction],
169 - ),
170 - child: PayjoinHistoryTile(
171 - createdAt: _formatTransactionDate(session.inProgressSince!, localeName),
172 - amount: dashboardViewModel.appStore.amountParsingProxy
173 - .asDisplayString(Money(
174 - session.amount, CryptoCurrency.btc)),
175 - currency: item.transaction?.from ?? "BTC",
176 - state: item.status,
177 - isSending: session.isSenderSession,
59 + : SliverPadding(
60 + padding: EdgeInsets.only(bottom: short ? 0 : 144),
61 + sliver: SliverList(
62 + delegate: SliverChildBuilderDelegate(
63 + childCount: items.length,
64 + (context, index) => Observer(builder: (_) {
65 + final prevItem = index == 0 ? null : items[index - 1];
66 + final topPadding = index == 0 ? 0.0 : 18.0;
67 + final item = items[index];
68 + final nextItem = index == items.length - 1
69 + ? null
70 + : items[index + 1];
71 +
72 + final roundedBottom = (nextItem == null || nextItem is DateSectionItem);
73 + final roundedTop = roundedTopSection && (prevItem == null || prevItem is DateSectionItem);
74 +
75 + if (item is TransactionListItem) {
76 + final transaction = item.transaction;
77 + final transactionType = dashboardViewModel.getTransactionType(transaction);
78 +
79 + if (item.hasTokens && item.assetOfTransaction == null) {
80 + return Container();
81 + }
82 +
83 + CryptoCurrency? asset;
84 + if (transaction.additionalInfo["isLightning"] == true)
85 + asset = CryptoCurrency.btcln;
86 + else
87 + asset = item.assetOfTransaction;
88 +
89 + return GestureDetector(
90 + onTap: () {
91 + final page = getIt.get<TransactionDetailsModal>(param1: transaction);
92 + if (detailsAsPage) {
93 + Navigator.of(context).push(
94 + CupertinoPageRoute(builder: (context) => Material(child: page)));
95 + } else {
96 + showModalBottomSheet(
97 + isScrollControlled: true,
98 + context: context,
99 + builder: (context) =>
100 + FractionallySizedBox(heightFactor: 0.9, child: page));
101 + }
102 + },
103 + child: HistoryTile(
104 + title: item.formattedTitle + transactionType,
105 + date: _formatTransactionDate(item.date, localeName),
106 + amount: item.formattedCryptoAmount,
107 + amountFiat: item.formattedFiatAmount,
108 + hasTokens: item.hasTokens,
109 + chainIconPath: _getChainIconPath(),
110 + roundedBottom: roundedBottom,
111 roundedTop: roundedTop,
112 + bottomSeparator: !roundedBottom,
113 + direction: item.transaction.direction,
114 + pending: item.transaction.isPending,
115 + asset: asset,
116 + ),
117 + );
118 + } else if (item is TradeListItem) {
119 + final trade = item.trade;
120 + final tradeFrom = trade.from;
121 + final tradeTo = trade.to;
122 +
123 + return GestureDetector(
124 + onTap: () => Navigator.of(context)
125 + .pushNamed(Routes.tradeDetails, arguments: trade),
126 + child: HistoryTradeTile(
127 + from: tradeFrom,
128 + to: tradeTo,
129 + provider: trade.provider,
130 + date: _formatTransactionDate(item.trade.createdAt ?? DateTime.now(), localeName),
131 + amount: dashboardViewModel.balanceDisplayMode == BalanceDisplayMode.hiddenBalance ? "---" : trade.amountFormatted(),
132 + receiveAmount: dashboardViewModel.balanceDisplayMode == BalanceDisplayMode.hiddenBalance ? "---" : trade.receiveAmountFormatted(),
133 roundedBottom: roundedBottom,
180 - bottomSeparator: !roundedBottom),
181 - );
182 - } else if (item is AnonpayTransactionListItem) {
183 - final transactionInfo = item.transaction;
184 -
185 - return GestureDetector(
134 + roundedTop: roundedTop,
135 + bottomSeparator: !roundedBottom,
136 + swapState: trade.state,
137 + ),
138 + );
139 + } else if (item is SpecificDateSectionItem) {
140 + return Padding(
141 + padding: EdgeInsets.only(left: 8.0, bottom: 8.0, top: topPadding),
142 + child: Text(item.text,
143 + style: TextStyle(
144 + color: Theme.of(context).colorScheme.onSurfaceVariant)));
145 + } else if (item is DateSectionItem) {
146 + return Padding(
147 + padding: EdgeInsets.only(left: 8.0, bottom: 8.0, top: topPadding),
148 + child: Text(DateFormat("MMMM yyyy", localeName).format(item.date),
149 + style: TextStyle(
150 + color: Theme.of(context).colorScheme.onSurfaceVariant)));
151 + } else if (item is OrderListItem) {
152 + return GestureDetector(
153 onTap: () => Navigator.of(context)
187 - .pushNamed(Routes.anonPayDetailsPage, arguments: transactionInfo),
188 - child: AnonpayHistoryTile(
189 - provider: transactionInfo.provider,
190 - createdAt: _formatTransactionDate(transactionInfo.createdAt, localeName),
191 - amount: transactionInfo.fiatAmount?.toString() ??
192 - (transactionInfo.amountTo?.toString() ?? ''),
193 - currency: transactionInfo.fiatAmount != null
194 - ? transactionInfo.fiatEquiv ?? ''
195 - : CryptoCurrency.fromFullName(transactionInfo.coinTo)
196 - .name
197 - .toUpperCase(),
154 + .pushNamed(Routes.orderDetails, arguments: item.order),
155 + child: HistoryOrderTile(
156 + date: _formatTransactionDate(item.order.createdAt, localeName),
157 + amount: item.orderFormattedAmount,
158 + amountFiat: "",
159 + roundedBottom: roundedBottom,
160 + roundedTop: roundedTop,
161 + bottomSeparator: !roundedBottom,
162 + ),
163 + );
164 + } else if (item is PayjoinTransactionListItem) {
165 + final session = item.session;
166 +
167 + return GestureDetector(
168 + onTap: () => Navigator.of(context).pushNamed(
169 + Routes.payjoinDetails,
170 + arguments: [item.sessionId, item.transaction],
171 + ),
172 + child: PayjoinHistoryTile(
173 + createdAt: _formatTransactionDate(session.inProgressSince!, localeName),
174 + amount: dashboardViewModel.appStore.amountParsingProxy
175 + .asDisplayString(Money(
176 + session.amount, CryptoCurrency.btc)),
177 + currency: item.transaction?.from ?? "BTC",
178 + state: item.status,
179 + isSending: session.isSenderSession,
180 roundedTop: roundedTop,
181 roundedBottom: roundedBottom,
200 - bottomSeparator: !roundedBottom));
201 - } else
202 - return Text(item.runtimeType.toString());
203 - }),
182 + bottomSeparator: !roundedBottom),
183 + );
184 + } else if (item is AnonpayTransactionListItem) {
185 + final transactionInfo = item.transaction;
186 +
187 + return GestureDetector(
188 + onTap: () => Navigator.of(context)
189 + .pushNamed(Routes.anonPayDetailsPage, arguments: transactionInfo),
190 + child: AnonpayHistoryTile(
191 + provider: transactionInfo.provider,
192 + createdAt: _formatTransactionDate(transactionInfo.createdAt, localeName),
193 + amount: transactionInfo.fiatAmount?.toString() ??
194 + (transactionInfo.amountTo?.toString() ?? ''),
195 + currency: transactionInfo.fiatAmount != null
196 + ? transactionInfo.fiatEquiv ?? ''
197 + : CryptoCurrency.fromFullName(transactionInfo.coinTo)
198 + .name
199 + .toUpperCase(),
200 + roundedTop: roundedTop,
201 + roundedBottom: roundedBottom,
202 + bottomSeparator: !roundedBottom));
203 + } else
204 + return Text(item.runtimeType.toString());
205 + }),
206 + ),
207 ),
205 - );
208 + );
209 },
210 ));
211 }
lib/new-ui/widgets/coins_page/assets_history/history_swap_providers_page.dart
+2 -2
@@ -42,9 +42,9 @@ class HistorySwapProvidersPage extends StatelessWidget {
42 title: S.of(context).swap_providers,
43 onSelected: (val) {
44 if ((val &&
45 - dashboardViewModel.tradeFilterStore.enabledProviders == 0) ||
45 + dashboardViewModel.tradeFilterStore.enabledProvidersCount == 0) ||
46 (!val &&
47 - dashboardViewModel.tradeFilterStore.enabledProviders > 0)) {
47 + dashboardViewModel.tradeFilterStore.enabledProvidersCount > 0)) {
48 dashboardViewModel.tradeFilterStore
49 .toggleDisplayExchange(ExchangeProviderDescription.all);
50 }
lib/store/dashboard/trade_filter_store.dart
+1 -1
@@ -70,7 +70,7 @@ abstract class TradeFilterStoreBase with Store {
70 bool displayNearIntents;
71
72 @computed
73 - int get enabledProviders => [
73 + int get enabledProvidersCount => [
74 displayChangeNow,
75 displaySideShift,
76 displaySimpleSwap,
lib/view_model/dashboard/dashboard_view_model.dart
+2 -2
@@ -274,9 +274,9 @@ abstract class DashboardViewModelBase with Store {
274 onChanged: transactionFilterStore.toggleSilentPayments,
275 ),
276 SwapFilterItem(
277 - enabledProviders: () => tradeFilterStore.enabledProviders,
277 + enabledProviders: () => tradeFilterStore.enabledProvidersCount,
278 allEnabled: () => tradeFilterStore.displayAllTrades,
279 - value: () => tradeFilterStore.enabledProviders>0,
279 + value: () => tradeFilterStore.enabledProvidersCount>0,
280 onChanged: () =>
281 tradeFilterStore.toggleDisplayExchange(ExchangeProviderDescription.all)),
282 FilterItem(