UI updates (#2368)

* Add Black theme

* Fix black theme

* Add WixMadefor Font

* feat: Enhance theme setup

This change:
- Adds support for custom themes
- Updates theme retrieval logic to ensure the right theme is used based on user preferences(especially for custom themes).

* Add black custom colors

* Add custom accent colors

* feat: Restructure custom colors handling for themes

* feat: Integrate new custom colors structure across various components - WIP

* feat: Integrate new custom colors structure across various components, black theme now ready for tests

* feat: Add new accent color themes and update theme selection UI

- Enhanced theme selection UI in display settings to support accent color choices.
- Updated theme handling logic to accommodate new accent color variants.

* Minor updates to display_settings_page.dart

* Update settings_theme_choice.dart

* Revert accidental change in display_settings_page.dart

* Revert WixMadeFor font, fix SVG colors for CakeImageWidget, and test some color changes

* Update Monero Orange

* fix: Remove unused custom colors

* Test outline

* Test spacing and colors

* Add padding

* Remove outline

* Add other accent colors

* Update display_settings_view_model.dart

* Update names and fix switch case

* Add outline and update dark_theme.dart colors

* Add gradient to option_tile.dart

* Update icons

* Update some colors

* Switch option_tile.dart to TextButton

* Add updated icons

* Fix icon resolution

* Cleanup old icons + Update pubspec_base.yaml

* Remove unused fonts

* Update more icons

* Update image paths

* Remove more icons + update some component colors

* Add back DAI icon

* Fix errors

* feat: Implement OLED mode for BlackTheme

* feat: Add OLED mode for BlackTheme and localizations

* feat: Implement OLED mode for Black Theme

* refactor: Remove unused theme parameters and set up easy access to toggleKnob custom colors

* fix: Cleanup UI and overflows

* feat: Persist black theme selection if OS theme mode while app is in system mode

* fix: OS theme change when app is in background restrict pin screen from proceed

* Fix theme picker sizing

* Update lib/src/screens/dashboard/desktop_widgets/desktop_wallet_selection_dropdown.dart

Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>

* refactor: Enhance theme access by introducing ThemeX extension for easier retrieval of current theme and custom colors

* refactor: Remove currentTheme parameter from GradientBackground widget and adjust across affected widgets

* refactor: Remove currentTheme parameter from StandardSwitch and SettingsSwitcherCell, using ThemeX extension for theme access

* refactor: Remove currentTheme parameter from various widgets dependent on SettingsSwitcherCell and StandardxSwitcher, using ThemeX extension for theme access

* refactor: Remove currentTheme in bottomsheets and related widgets, switching to theme extension

* refactor: Remove constructor theme access in OptionTile and related widgets, switching to theme extension

* refactor: Switch bottomsheet related widgets to use theme extension instead of constructor access

* refactor: Migrate currentTheme access from constructor based to extension base

* refactor: Switch theme access from constructor base to extension base [skip ci]

* refactor: Migrate more widgets to use extension based theme access and clean up code

* refactor: Update theme access across multiple widgets to use the new theme extension

* refactor: Clean up theme access in various widgets, moving to extension-based theme usage

* refactor: Make theme picker preview responsive

* fix: Persist saved black theme accent when app is put in background and brought back

* remove unused variables [skip ci]

---------

Co-authored-by: Blazebrain <davidadegoke16@gmail.com>
Co-authored-by: Omar Hatem <omarh.ismail1@gmail.com>
This commit is contained in:
tuxsudo
2025-10-10 16:00:39 +03:00
committed by GitHub
co-authored by Omar Hatem Blazebrain
parent 85a9e36f2e
commit c746b85a4b
329 changed files with 2148 additions and 1335 deletions
@@ -2,18 +2,16 @@ import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/themes/core/theme_extension.dart';
import 'package:flutter/material.dart';
class AddPassphraseBottomSheet extends StatefulWidget {
AddPassphraseBottomSheet({
required String titleText,
required this.currentTheme,
required this.onRestoreButtonPressed,
});
final void Function(String) onRestoreButtonPressed;
final MaterialThemeBase currentTheme;
@override
State<AddPassphraseBottomSheet> createState() => _AddPassphraseBottomSheetState();
@@ -43,8 +41,8 @@ class _AddPassphraseBottomSheetState extends State<AddPassphraseBottomSheet> {
bool obscurePassphrase = true;
@override
Widget build(BuildContext context) {
final passphraseImage = widget.currentTheme.isDark ? passphraseImageDark : passphraseImageLight;
final passphraseImage =
context.currentTheme.isDark ? passphraseImageDark : passphraseImageLight;
return Container(
decoration: BoxDecoration(
@@ -1,6 +1,5 @@
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/widgets/standard_slide_button_widget.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:flutter/material.dart';
enum FooterType { none, slideActionButton, singleActionButton, doubleActionButton }
@@ -11,7 +10,6 @@ abstract class BaseBottomSheet extends StatelessWidget {
required this.titleText,
this.titleIconPath,
required this.footerType,
this.currentTheme,
this.slideActionButtonText,
this.onSlideActionComplete,
this.singleActionButtonText,
@@ -25,12 +23,11 @@ abstract class BaseBottomSheet extends StatelessWidget {
this.leftActionButtonKey,
this.rightActionButtonKey,
required this.maxHeight,
}) : assert(footerType == FooterType.none || currentTheme != null,
}) : assert(footerType == FooterType.none,
'currentTheme is required unless footerType is none');
final String titleText;
final String? titleIconPath;
final MaterialThemeBase? currentTheme;
final FooterType footerType;
final String? slideActionButtonText;
final VoidCallback? onSlideActionComplete;
@@ -115,7 +112,6 @@ abstract class BaseBottomSheet extends StatelessWidget {
key: ValueKey('base_bottom_sheet_widget_standard_slide_button_key'),
buttonText: slideActionButtonText ?? '',
onSlideComplete: onSlideActionComplete ?? () {},
currentTheme: currentTheme!,
accessibleNavigationModeButtonText: accessibleNavigationModeSlideActionButtonText ?? '',
),
);
@@ -2,8 +2,6 @@ import 'package:cake_wallet/cake_pay/src/widgets/cake_pay_alert_modal.dart';
import 'package:cake_wallet/cake_pay/src/widgets/flip_card_widget.dart';
import 'package:cake_wallet/cake_pay/src/widgets/link_extractor.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/utils/image_utill.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart';
@@ -13,7 +11,6 @@ import 'base_bottom_sheet_widget.dart';
class CakePayCardInfoBottomSheet extends BaseBottomSheet {
CakePayCardInfoBottomSheet({
required String titleText,
required MaterialThemeBase currentTheme,
required FooterType footerType,
String? titleIconPath,
String? singleActionButtonText,
@@ -32,12 +29,10 @@ class CakePayCardInfoBottomSheet extends BaseBottomSheet {
this.howToUse,
this.applyBoxShadow = false,
Key? key,
}) : _currentTheme = currentTheme,
super(
}) : super(
titleText: titleText,
maxHeight: 900,
titleIconPath: titleIconPath,
currentTheme: currentTheme,
footerType: footerType,
singleActionButtonText: singleActionButtonText,
onSingleActionButtonPressed: onSingleActionButtonPressed,
@@ -51,7 +46,6 @@ class CakePayCardInfoBottomSheet extends BaseBottomSheet {
key: key);
final VoidCallback onUpdateBalancePressed;
final MaterialThemeBase _currentTheme;
final String? contentImage;
final String? howToUse;
final bool isReloadable;
@@ -63,15 +57,15 @@ class CakePayCardInfoBottomSheet extends BaseBottomSheet {
@override
Widget contentWidget(BuildContext context) {
final itemTitleTextStyle = Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.none,
);
fontSize: 16,
fontWeight: FontWeight.w500,
decoration: TextDecoration.none,
);
final itemSubTitleTextStyle = Theme.of(context).textTheme.bodySmall!.copyWith(
fontWeight: FontWeight.w600,
color: Theme.of(context).colorScheme.onSurfaceVariant,
decoration: TextDecoration.none,
);
fontWeight: FontWeight.w600,
color: Theme.of(context).colorScheme.onSurfaceVariant,
decoration: TextDecoration.none,
);
final tileBackgroundColor = Theme.of(context).colorScheme.surfaceContainer;
@@ -165,9 +159,7 @@ class _HowToUseTile extends StatelessWidget {
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
S.of(context).how_to_use_card,
style: Theme.of(context).textTheme.bodyLarge),
Text(S.of(context).how_to_use_card, style: Theme.of(context).textTheme.bodyLarge),
Icon(
Icons.chevron_right_rounded,
color: Theme.of(context).textTheme.titleLarge!.color!,
@@ -261,11 +253,9 @@ Widget _buildCardImage(BuildContext ctx, String path, bool addShadow) {
return Container(
decoration: addShadow
? BoxDecoration(
borderRadius: border,
boxShadow: [
BoxShadow(color: Colors.black.withAlpha(150), blurRadius: 5)
],
)
borderRadius: border,
boxShadow: [BoxShadow(color: Colors.black.withAlpha(150), blurRadius: 5)],
)
: null,
child: ClipRRect(
borderRadius: border,
@@ -290,9 +280,7 @@ Widget _buildBarcodeSide(BuildContext context, {required String cardNumber, requ
decoration: BoxDecoration(
color: Theme.of(context).cardColor.withAlpha(200),
borderRadius: BorderRadius.circular(10),
boxShadow: [
BoxShadow(color: Colors.black.withAlpha(150), blurRadius: 5)
],
boxShadow: [BoxShadow(color: Colors.black.withAlpha(150), blurRadius: 5)],
),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
@@ -300,7 +288,6 @@ Widget _buildBarcodeSide(BuildContext context, {required String cardNumber, requ
Expanded(
child: Container(
color: Theme.of(context).textTheme.titleLarge!.color!.withOpacity(.1),
),
),
const SizedBox(height: 12),
@@ -345,7 +332,6 @@ Widget _buildBarcodeSide(BuildContext context, {required String cardNumber, requ
),
],
),
],
),
),
@@ -1,7 +1,6 @@
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/rounded_icon_button.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
import 'package:cake_wallet/themes/core/theme_extension.dart';
import 'package:cake_wallet/utils/address_formatter.dart';
import 'package:cake_wallet/utils/image_utill.dart';
import 'package:cake_wallet/view_model/cake_pay/cake_pay_buy_card_view_model.dart';
@@ -18,7 +17,6 @@ import 'base_bottom_sheet_widget.dart';
class ConfirmSendingBottomSheet extends BaseBottomSheet {
ConfirmSendingBottomSheet({
required String titleText,
required MaterialThemeBase currentTheme,
required FooterType footerType,
String? titleIconPath,
String? slideActionButtonText,
@@ -43,12 +41,10 @@ class ConfirmSendingBottomSheet extends BaseBottomSheet {
this.quantity,
Key? key,
}) : showScrollbar = outputs.length > 3,
_currentTheme = currentTheme,
super(
titleText: titleText,
maxHeight: 900,
titleIconPath: titleIconPath,
currentTheme: currentTheme,
footerType: footerType,
slideActionButtonText: slideActionButtonText ?? 'Swipe to send',
onSlideActionComplete: onSlideActionComplete,
@@ -57,7 +53,6 @@ class ConfirmSendingBottomSheet extends BaseBottomSheet {
key: key);
final CryptoCurrency currency;
final MaterialThemeBase _currentTheme;
final String? paymentId;
final String? paymentIdValue;
final String? expirationTime;
@@ -91,9 +86,9 @@ class ConfirmSendingBottomSheet extends BaseBottomSheet {
decoration: TextDecoration.none,
);
final tileBackgroundColor = _currentTheme.isDark
? CustomThemeColors.backgroundGradientColorDark.withAlpha(140)
: CustomThemeColors.cardGradientColorPrimaryLight;
final tileBackgroundColor = context.currentTheme.isDark
? context.customColors.backgroundGradientColor.withAlpha(140)
: context.customColors.cardGradientColorPrimary;
Widget content = Padding(
padding: EdgeInsets.fromLTRB(8, 0, showScrollbar ? 16 : 8, 8),
@@ -1,17 +1,8 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:cake_wallet/src/widgets/simple_checkbox.dart';
import 'package:cake_wallet/utils/image_utill.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
@@ -19,9 +10,12 @@ import 'package:flutter/material.dart';
import 'base_bottom_sheet_widget.dart';
class LoadingBottomSheet extends BaseBottomSheet {
LoadingBottomSheet(
{required String titleText, String? titleIconPath})
: super(titleText: titleText, titleIconPath: titleIconPath, footerType: FooterType.none, maxHeight: 900);
LoadingBottomSheet({required String titleText, String? titleIconPath})
: super(
titleText: titleText,
titleIconPath: titleIconPath,
footerType: FooterType.none,
maxHeight: 900);
@override
Widget contentWidget(BuildContext context) {
@@ -36,7 +30,6 @@ class InfoBottomSheet extends BaseBottomSheet {
InfoBottomSheet({
required String titleText,
String? titleIconPath,
required this.currentTheme,
required this.footerType,
this.contentImage,
this.contentImageColor,
@@ -59,7 +52,6 @@ class InfoBottomSheet extends BaseBottomSheet {
titleText: titleText,
titleIconPath: titleIconPath,
maxHeight: 900,
currentTheme: currentTheme,
footerType: footerType,
singleActionButtonText: singleActionButtonText,
onSingleActionButtonPressed: onSingleActionButtonPressed,
@@ -72,7 +64,6 @@ class InfoBottomSheet extends BaseBottomSheet {
rightActionButtonKey: rightActionButtonKey,
key: key);
final MaterialThemeBase currentTheme;
final FooterType footerType;
final String? contentImage;
final Color? contentImageColor;
@@ -91,7 +82,6 @@ class InfoBottomSheet extends BaseBottomSheet {
final double? contentImageSize;
final bool showDisclaimerText;
@override
Widget contentWidget(BuildContext context) {
return SizedBox(
@@ -137,35 +127,36 @@ class InfoBottomSheet extends BaseBottomSheet {
bottomActionPanel ?? const SizedBox(),
if (showDisclaimerText)
Padding(
padding: const EdgeInsets.only(top: 20, bottom: 10),
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
padding: const EdgeInsets.only(top: 20, bottom: 10),
child: RichText(
textAlign: TextAlign.center,
text: TextSpan(
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
children: [
TextSpan(
text: 'By continuing you agree to this ',
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
fontWeight: FontWeight.w500,
),
),
TextSpan(
text: 'disclaimer',
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
decoration: TextDecoration.underline,
fontWeight: FontWeight.w700,
),
recognizer: TapGestureRecognizer()
..onTap =
() => Navigator.pushNamed(context, Routes.readThirdPartyDisclaimer),
),
],
),
children: [
TextSpan(
text: 'By continuing you agree to this ',
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
fontWeight: FontWeight.w500,
),
),
TextSpan(
text: 'disclaimer',
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
decoration: TextDecoration.underline,
fontWeight: FontWeight.w700,
),
recognizer: TapGestureRecognizer()
..onTap = () => Navigator.pushNamed(context, Routes.readThirdPartyDisclaimer),
),
],
),
),
),
],
),
);
@@ -1,6 +1,6 @@
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/themes/core/theme_extension.dart';
import 'package:flutter/material.dart';
import 'base_bottom_sheet_widget.dart';
@@ -13,15 +13,17 @@ class InfoStep {
}
class InfoStepsBottomSheet extends BaseBottomSheet {
final MaterialThemeBase currentTheme;
final List<InfoStep> steps;
InfoStepsBottomSheet({
required String titleText,
required this.steps,
String? titleIconPath,
required this.currentTheme,
}) : super(titleText: titleText, titleIconPath: titleIconPath, footerType: FooterType.none, maxHeight: 900);
}) : super(
titleText: titleText,
titleIconPath: titleIconPath,
footerType: FooterType.none,
maxHeight: 900);
@override
Widget contentWidget(BuildContext context) => SizedBox(
@@ -33,8 +35,7 @@ class InfoStepsBottomSheet extends BaseBottomSheet {
child: Column(
children: steps
.map((step) => Container(
margin: EdgeInsets.only(
bottom: 15, left: 20, right: 20),
margin: EdgeInsets.only(bottom: 15, left: 20, right: 20),
padding: EdgeInsets.all(10),
alignment: Alignment.center,
decoration: BoxDecoration(
@@ -51,35 +52,24 @@ class InfoStepsBottomSheet extends BaseBottomSheet {
padding: EdgeInsets.only(left: 16),
child: Column(
mainAxisSize: MainAxisSize.max,
mainAxisAlignment:
MainAxisAlignment.start,
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
step.title,
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 20,
fontWeight: FontWeight.w500,
color: Theme.of(context)
.colorScheme
.onSurface,
color: context.currentTheme.colorScheme.onSurface,
),
),
Padding(
padding: EdgeInsets.only(top: 5),
child: Text(
step.description,
style: Theme.of(context)
.textTheme
.bodyMedium!
.copyWith(
color: Theme.of(context)
.colorScheme
.onSurfaceVariant,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
color: context
.currentTheme.colorScheme.onSurfaceVariant,
),
),
)
@@ -98,10 +88,10 @@ class InfoStepsBottomSheet extends BaseBottomSheet {
padding: const EdgeInsets.all(16),
child: PrimaryButton(
text: S.of(context).close,
color: Theme.of(context).colorScheme.primary,
textColor: currentTheme.isDark
? Theme.of(context).colorScheme.onSurfaceVariant
: Theme.of(context).colorScheme.onPrimary,
color: context.currentTheme.colorScheme.primary,
textColor: context.currentTheme.isDark
? context.currentTheme.colorScheme.onSurfaceVariant
: context.currentTheme.colorScheme.onPrimary,
onPressed: () => Navigator.of(context).pop(),
),
)
@@ -6,7 +6,6 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:cake_wallet/view_model/payment/payment_view_model.dart';
import 'package:cake_wallet/view_model/wallet_switcher_view_model.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
class PaymentConfirmationBottomSheet extends BaseBottomSheet {
@@ -15,7 +14,6 @@ class PaymentConfirmationBottomSheet extends BaseBottomSheet {
required this.paymentFlowResult,
required this.paymentViewModel,
required this.walletSwitcherViewModel,
required this.currentTheme,
required this.paymentRequest,
required this.onSelectWallet,
required this.onChangeWallet,
@@ -24,13 +22,11 @@ class PaymentConfirmationBottomSheet extends BaseBottomSheet {
titleText: '',
footerType: FooterType.none,
maxHeight: 900,
currentTheme: currentTheme,
);
final PaymentFlowResult paymentFlowResult;
final PaymentViewModel paymentViewModel;
final WalletSwitcherViewModel walletSwitcherViewModel;
final MaterialThemeBase currentTheme;
final PaymentRequest paymentRequest;
final VoidCallback onSelectWallet;
final VoidCallback onChangeWallet;
@@ -19,7 +19,6 @@ import 'package:cw_core/wallet_type.dart';
import 'package:cake_wallet/view_model/payment/payment_view_model.dart';
import 'package:cake_wallet/view_model/exchange/exchange_view_model.dart';
import 'package:cake_wallet/exchange/exchange_trade_state.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
@@ -29,7 +28,6 @@ class SwapConfirmationBottomSheet extends BaseBottomSheet {
SwapConfirmationBottomSheet({
Key? key,
required this.paymentFlowResult,
required this.currentTheme,
required this.exchangeViewModel,
required this.authService,
this.sessionId,
@@ -37,11 +35,9 @@ class SwapConfirmationBottomSheet extends BaseBottomSheet {
titleText: S.current.swap,
footerType: FooterType.none,
maxHeight: 900,
currentTheme: currentTheme,
);
final PaymentFlowResult paymentFlowResult;
final MaterialThemeBase currentTheme;
final ExchangeViewModel exchangeViewModel;
final AuthService authService;
final String? sessionId;
@@ -7,7 +7,6 @@ import 'package:cake_wallet/src/widgets/bottom_sheet/base_bottom_sheet_widget.da
import 'package:cw_core/wallet_type.dart';
import 'package:cake_wallet/view_model/exchange/exchange_trade_view_model.dart';
import 'package:cake_wallet/src/widgets/standard_slide_button_widget.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/core/execution_state.dart';
import 'package:cake_wallet/view_model/send/send_view_model_state.dart';
import 'package:cake_wallet/src/widgets/bottom_sheet/info_bottom_sheet_widget.dart';
@@ -22,11 +21,9 @@ import 'package:flutter_mobx/flutter_mobx.dart';
class SwapDetailsBottomSheet extends StatefulWidget {
SwapDetailsBottomSheet({
Key? key,
required this.currentTheme,
required this.exchangeTradeViewModel,
}) : super(key: key);
final MaterialThemeBase currentTheme;
final ExchangeTradeViewModel exchangeTradeViewModel;
@override
@@ -124,7 +121,6 @@ class _SwapDetailsBottomSheetState extends State<SwapDetailsBottomSheet> {
isScrollControlled: true,
builder: (BuildContext bottomSheetContext) {
return InfoBottomSheet(
currentTheme: widget.currentTheme,
footerType: FooterType.singleActionButton,
titleText: S.of(bottomSheetContext).transaction_sent,
contentImage: 'assets/images/birthday_cake.png',
@@ -155,7 +151,6 @@ class _SwapDetailsBottomSheetState extends State<SwapDetailsBottomSheet> {
titleText: 'Confirm Swap',
footerType: FooterType.none,
maxHeight: 900,
currentTheme: widget.currentTheme,
exchangeTradeViewModel: widget.exchangeTradeViewModel,
onExecuteSwap: _executeSwap,
);
@@ -192,14 +187,12 @@ class _SwapDetailsBottomSheetContent extends BaseBottomSheet {
required String titleText,
required FooterType footerType,
required double maxHeight,
MaterialThemeBase? currentTheme,
required this.exchangeTradeViewModel,
required this.onExecuteSwap,
}) : super(
titleText: titleText,
footerType: footerType,
maxHeight: maxHeight,
currentTheme: currentTheme,
);
final ExchangeTradeViewModel exchangeTradeViewModel;
@@ -250,7 +243,6 @@ class _SwapDetailsBottomSheetContent extends BaseBottomSheet {
knobColor: Theme.of(context).colorScheme.primary,
buttonText: 'Swipe to swap',
onSlideComplete: onExecuteSwap,
currentTheme: currentTheme!,
accessibleNavigationModeButtonText: 'Complete swap',
);
},
@@ -6,7 +6,6 @@ class TooltipSheet extends BaseBottomSheet {
final String tooltip;
const TooltipSheet({
required super.currentTheme,
required super.titleText,
super.titleIconPath,
required this.tooltip,
@@ -25,22 +24,22 @@ class TooltipSheet extends BaseBottomSheet {
@override
Widget contentWidget(BuildContext context) => Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Theme.of(context).colorScheme.surfaceContainer),
margin: const EdgeInsets.all(12),
padding: const EdgeInsets.all(12),
child: AutoSizeText(
tooltip,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurfaceVariant,
decoration: TextDecoration.none,
),
),
);
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Theme.of(context).colorScheme.surfaceContainer),
margin: const EdgeInsets.all(12),
padding: const EdgeInsets.all(12),
child: AutoSizeText(
tooltip,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurfaceVariant,
decoration: TextDecoration.none,
),
),
);
Widget footerWidget(BuildContext context) => SizedBox.shrink();
}
@@ -6,13 +6,11 @@ import 'package:cw_core/wallet_info.dart';
import 'package:cw_core/wallet_type.dart';
import 'package:cake_wallet/view_model/wallet_switcher_view_model.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
class WalletSwitcherBottomSheet extends BaseBottomSheet {
WalletSwitcherBottomSheet({
Key? key,
required this.viewModel,
required this.currentTheme,
this.filterWalletType,
this.subtitle,
this.onWalletSelected,
@@ -20,11 +18,9 @@ class WalletSwitcherBottomSheet extends BaseBottomSheet {
titleText: S.current.select_a_wallet,
footerType: FooterType.none,
maxHeight: 900,
currentTheme: currentTheme,
);
final WalletSwitcherViewModel viewModel;
final MaterialThemeBase currentTheme;
final WalletType? filterWalletType;
final String? subtitle;
final Function(WalletInfo)? onWalletSelected;