fix: Background color for swap screen and external send details screen looking wierd across themes (#2151)
David Adegoke committed
Apr 2, 2025 at 16:32 UTC
b80afb1efe98755207860a4a997fe9bac85fe7f2
2 files changed
+24
-32
lib/src/screens/exchange_trade/exchange_trade_external_send_page.dart
+1
-4
@@ -19,9 +19,6 @@ class ExchangeTradeExternalSendPage extends BasePage {
19
@override
20
String get title => S.current.swap;
21
22
- @override
23
- bool get gradientBackground => true;
24
-
22
@override
23
bool get gradientAll => true;
24
@@ -46,7 +43,7 @@ class ExchangeTradeExternalSendPage extends BasePage {
43
);
44
return Container(
45
child: ScrollableWithBottomSection(
49
- contentPadding: EdgeInsets.only(top: 36, bottom: 24),
46
+ contentPadding: EdgeInsets.only(bottom: 24),
47
content: Observer(
48
builder: (_) {
49
return Column(
lib/src/screens/exchange_trade/exchange_trade_page.dart
+23
-28
@@ -26,23 +26,20 @@ import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
26
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
27
import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
28
29
-void showInformation(
30
- ExchangeTradeViewModel exchangeTradeViewModel, BuildContext context) {
29
+void showInformation(ExchangeTradeViewModel exchangeTradeViewModel, BuildContext context) {
30
final trade = exchangeTradeViewModel.trade;
31
final walletName = exchangeTradeViewModel.wallet.name;
32
33
final information = exchangeTradeViewModel.isSendable
34
? S.current.exchange_trade_result_confirm(trade.amount, trade.from.toString(), walletName) +
36
- exchangeTradeViewModel.extraInfo
37
- : S.current.exchange_result_description(
38
- trade.amount, trade.from.toString()) +
39
- exchangeTradeViewModel.extraInfo;
35
+ exchangeTradeViewModel.extraInfo
36
+ : S.current.exchange_result_description(trade.amount, trade.from.toString()) +
37
+ exchangeTradeViewModel.extraInfo;
38
39
showPopUp<void>(
40
context: context,
43
- builder: (_) => InformationPage(
44
- key: ValueKey('information_page_dialog_key'),
45
- information: information));
41
+ builder: (_) =>
42
+ InformationPage(key: ValueKey('information_page_dialog_key'), information: information));
43
}
44
45
class ExchangeTradePage extends BasePage {
@@ -53,9 +50,6 @@ class ExchangeTradePage extends BasePage {
50
@override
51
String get title => S.current.swap;
52
56
- @override
57
- bool get gradientBackground => true;
58
-
53
@override
54
bool get gradientAll => true;
55
@@ -141,7 +135,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
135
136
return Container(
137
child: ScrollableWithBottomSection(
144
- contentPadding: EdgeInsets.only(top: 10, bottom: 16),
138
+ contentPadding: EdgeInsets.only(bottom: 16),
139
content: Observer(builder: (_) {
140
final trade = widget.exchangeTradeViewModel.trade;
141
@@ -198,7 +192,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
192
isDisabled: trade.inputAddress == null || trade.inputAddress!.isEmpty,
193
isLoading: sendingState is IsExecutingState,
194
onPressed: () => widget.exchangeTradeViewModel.confirmSending(),
201
- text:S.current.send_from_cake_wallet,
195
+ text: S.current.send_from_cake_wallet,
196
color: Theme.of(context).primaryColor,
197
textColor: Colors.white,
198
)
@@ -220,12 +214,11 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
214
215
_exchangeStateReaction = reaction((_) => this.widget.exchangeTradeViewModel.sendViewModel.state,
216
(ExecutionState state) {
223
-
224
- if (state is! IsExecutingState &&
225
- loadingBottomSheetContext != null &&
226
- loadingBottomSheetContext!.mounted) {
227
- Navigator.of(loadingBottomSheetContext!).pop();
228
- }
217
+ if (state is! IsExecutingState &&
218
+ loadingBottomSheetContext != null &&
219
+ loadingBottomSheetContext!.mounted) {
220
+ Navigator.of(loadingBottomSheetContext!).pop();
221
+ }
222
223
if (state is FailureState) {
224
WidgetsBinding.instance.addPostFrameCallback((_) {
@@ -272,16 +265,21 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
265
key: ValueKey('exchange_trade_page_confirm_sending_bottom_sheet_key'),
266
currentTheme: widget.currentTheme,
267
titleText: S.of(bottomSheetContext).confirm_transaction,
275
- titleIconPath: widget.exchangeTradeViewModel.sendViewModel.selectedCryptoCurrency.iconPath,
268
+ titleIconPath:
269
+ widget.exchangeTradeViewModel.sendViewModel.selectedCryptoCurrency.iconPath,
270
currency: widget.exchangeTradeViewModel.sendViewModel.selectedCryptoCurrency,
271
amount: S.of(bottomSheetContext).send_amount,
278
- amountValue: widget.exchangeTradeViewModel.sendViewModel.pendingTransaction!.amountFormatted,
279
- fiatAmountValue: widget.exchangeTradeViewModel.sendViewModel.pendingTransactionFiatAmountFormatted,
272
+ amountValue: widget
273
+ .exchangeTradeViewModel.sendViewModel.pendingTransaction!.amountFormatted,
274
+ fiatAmountValue: widget
275
+ .exchangeTradeViewModel.sendViewModel.pendingTransactionFiatAmountFormatted,
276
fee: isEVMCompatibleChain(widget.exchangeTradeViewModel.sendViewModel.walletType)
277
? S.of(bottomSheetContext).send_estimated_fee
278
: S.of(bottomSheetContext).send_fee,
283
- feeValue: widget.exchangeTradeViewModel.sendViewModel.pendingTransaction!.feeFormatted,
284
- feeFiatAmount: widget.exchangeTradeViewModel.sendViewModel.pendingTransactionFeeFiatAmountFormatted,
279
+ feeValue:
280
+ widget.exchangeTradeViewModel.sendViewModel.pendingTransaction!.feeFormatted,
281
+ feeFiatAmount: widget.exchangeTradeViewModel.sendViewModel
282
+ .pendingTransactionFeeFiatAmountFormatted,
283
outputs: widget.exchangeTradeViewModel.sendViewModel.outputs,
284
onSlideComplete: () async {
285
Navigator.of(bottomSheetContext).pop();
@@ -300,7 +298,6 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
298
return;
299
}
300
303
-
301
await showModalBottomSheet<void>(
302
context: context,
303
isScrollControlled: true,
@@ -321,10 +318,8 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
318
});
319
},
320
);
324
-
321
});
322
}
327
-
323
});
324
325
_effectsInstalled = true;