fix: Background color for swap screen and external send details screen looking wierd across themes (#2151)

This commit is contained in:
David Adegoke 2025-04-02 16:32:57 +01:00 committed by GitHub
parent 79fe9da6b7
commit b80afb1efe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 32 deletions

View file

@ -19,9 +19,6 @@ class ExchangeTradeExternalSendPage extends BasePage {
@override @override
String get title => S.current.swap; String get title => S.current.swap;
@override
bool get gradientBackground => true;
@override @override
bool get gradientAll => true; bool get gradientAll => true;
@ -46,7 +43,7 @@ class ExchangeTradeExternalSendPage extends BasePage {
); );
return Container( return Container(
child: ScrollableWithBottomSection( child: ScrollableWithBottomSection(
contentPadding: EdgeInsets.only(top: 36, bottom: 24), contentPadding: EdgeInsets.only(bottom: 24),
content: Observer( content: Observer(
builder: (_) { builder: (_) {
return Column( return Column(

View file

@ -26,23 +26,20 @@ import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart'; import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart'; import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
void showInformation( void showInformation(ExchangeTradeViewModel exchangeTradeViewModel, BuildContext context) {
ExchangeTradeViewModel exchangeTradeViewModel, BuildContext context) {
final trade = exchangeTradeViewModel.trade; final trade = exchangeTradeViewModel.trade;
final walletName = exchangeTradeViewModel.wallet.name; final walletName = exchangeTradeViewModel.wallet.name;
final information = exchangeTradeViewModel.isSendable final information = exchangeTradeViewModel.isSendable
? S.current.exchange_trade_result_confirm(trade.amount, trade.from.toString(), walletName) + ? S.current.exchange_trade_result_confirm(trade.amount, trade.from.toString(), walletName) +
exchangeTradeViewModel.extraInfo exchangeTradeViewModel.extraInfo
: S.current.exchange_result_description( : S.current.exchange_result_description(trade.amount, trade.from.toString()) +
trade.amount, trade.from.toString()) +
exchangeTradeViewModel.extraInfo; exchangeTradeViewModel.extraInfo;
showPopUp<void>( showPopUp<void>(
context: context, context: context,
builder: (_) => InformationPage( builder: (_) =>
key: ValueKey('information_page_dialog_key'), InformationPage(key: ValueKey('information_page_dialog_key'), information: information));
information: information));
} }
class ExchangeTradePage extends BasePage { class ExchangeTradePage extends BasePage {
@ -53,9 +50,6 @@ class ExchangeTradePage extends BasePage {
@override @override
String get title => S.current.swap; String get title => S.current.swap;
@override
bool get gradientBackground => true;
@override @override
bool get gradientAll => true; bool get gradientAll => true;
@ -141,7 +135,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
return Container( return Container(
child: ScrollableWithBottomSection( child: ScrollableWithBottomSection(
contentPadding: EdgeInsets.only(top: 10, bottom: 16), contentPadding: EdgeInsets.only(bottom: 16),
content: Observer(builder: (_) { content: Observer(builder: (_) {
final trade = widget.exchangeTradeViewModel.trade; final trade = widget.exchangeTradeViewModel.trade;
@ -220,7 +214,6 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
_exchangeStateReaction = reaction((_) => this.widget.exchangeTradeViewModel.sendViewModel.state, _exchangeStateReaction = reaction((_) => this.widget.exchangeTradeViewModel.sendViewModel.state,
(ExecutionState state) { (ExecutionState state) {
if (state is! IsExecutingState && if (state is! IsExecutingState &&
loadingBottomSheetContext != null && loadingBottomSheetContext != null &&
loadingBottomSheetContext!.mounted) { loadingBottomSheetContext!.mounted) {
@ -272,16 +265,21 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
key: ValueKey('exchange_trade_page_confirm_sending_bottom_sheet_key'), key: ValueKey('exchange_trade_page_confirm_sending_bottom_sheet_key'),
currentTheme: widget.currentTheme, currentTheme: widget.currentTheme,
titleText: S.of(bottomSheetContext).confirm_transaction, titleText: S.of(bottomSheetContext).confirm_transaction,
titleIconPath: widget.exchangeTradeViewModel.sendViewModel.selectedCryptoCurrency.iconPath, titleIconPath:
widget.exchangeTradeViewModel.sendViewModel.selectedCryptoCurrency.iconPath,
currency: widget.exchangeTradeViewModel.sendViewModel.selectedCryptoCurrency, currency: widget.exchangeTradeViewModel.sendViewModel.selectedCryptoCurrency,
amount: S.of(bottomSheetContext).send_amount, amount: S.of(bottomSheetContext).send_amount,
amountValue: widget.exchangeTradeViewModel.sendViewModel.pendingTransaction!.amountFormatted, amountValue: widget
fiatAmountValue: widget.exchangeTradeViewModel.sendViewModel.pendingTransactionFiatAmountFormatted, .exchangeTradeViewModel.sendViewModel.pendingTransaction!.amountFormatted,
fiatAmountValue: widget
.exchangeTradeViewModel.sendViewModel.pendingTransactionFiatAmountFormatted,
fee: isEVMCompatibleChain(widget.exchangeTradeViewModel.sendViewModel.walletType) fee: isEVMCompatibleChain(widget.exchangeTradeViewModel.sendViewModel.walletType)
? S.of(bottomSheetContext).send_estimated_fee ? S.of(bottomSheetContext).send_estimated_fee
: S.of(bottomSheetContext).send_fee, : S.of(bottomSheetContext).send_fee,
feeValue: widget.exchangeTradeViewModel.sendViewModel.pendingTransaction!.feeFormatted, feeValue:
feeFiatAmount: widget.exchangeTradeViewModel.sendViewModel.pendingTransactionFeeFiatAmountFormatted, widget.exchangeTradeViewModel.sendViewModel.pendingTransaction!.feeFormatted,
feeFiatAmount: widget.exchangeTradeViewModel.sendViewModel
.pendingTransactionFeeFiatAmountFormatted,
outputs: widget.exchangeTradeViewModel.sendViewModel.outputs, outputs: widget.exchangeTradeViewModel.sendViewModel.outputs,
onSlideComplete: () async { onSlideComplete: () async {
Navigator.of(bottomSheetContext).pop(); Navigator.of(bottomSheetContext).pop();
@ -300,7 +298,6 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
return; return;
} }
await showModalBottomSheet<void>( await showModalBottomSheet<void>(
context: context, context: context,
isScrollControlled: true, isScrollControlled: true,
@ -321,10 +318,8 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
}); });
}, },
); );
}); });
} }
}); });
_effectsInstalled = true; _effectsInstalled = true;