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
@@ -39,9 +39,8 @@ import 'package:keyboard_actions/keyboard_actions.dart';
import 'package:mobx/mobx.dart';
class CakePayBuyCardPage extends BasePage {
CakePayBuyCardPage(
this.cakePayBuyCardViewModel
) : _sendViewModel = cakePayBuyCardViewModel.sendViewModel,
CakePayBuyCardPage(this.cakePayBuyCardViewModel)
: _sendViewModel = cakePayBuyCardViewModel.sendViewModel,
_amountFieldFocus = FocusNode(),
_amountController = TextEditingController(),
_quantityFieldFocus = FocusNode(),
@@ -303,7 +302,8 @@ class CakePayBuyCardPage extends BasePage {
methods.length <= 1 || selected == null
? const SizedBox.shrink()
: _buildPaymentMethodWidget(methods, selected),
if (_sendViewModel.walletType == WalletType.litecoin && _sendViewModel.isMwebEnabled)
if (_sendViewModel.walletType == WalletType.litecoin &&
_sendViewModel.isMwebEnabled)
Observer(
builder: (_) => Padding(
padding: EdgeInsets.only(top: 10, bottom: 0, right: 20, left: 20),
@@ -323,8 +323,7 @@ class CakePayBuyCardPage extends BasePage {
captionColor: Theme.of(context).colorScheme.onSurfaceVariant,
borderColor: Theme.of(context).colorScheme.primary,
iconColor: Theme.of(context).colorScheme.primary,
value:
_sendViewModel.coinTypeToSpendFrom == UnspentCoinType.any,
value: _sendViewModel.coinTypeToSpendFrom == UnspentCoinType.any,
onChanged: (bool? value) {
_sendViewModel.setAllowMwebCoins(value ?? false);
},
@@ -351,9 +350,8 @@ class CakePayBuyCardPage extends BasePage {
text: '(Dev) Simulate Purchasing Gift Card',
isDisabled: !cakePayBuyCardViewModel.isAmountSufficient ||
cakePayBuyCardViewModel.isPurchasing,
isLoading:
_sendViewModel.state is IsExecutingState ||
cakePayBuyCardViewModel.isPurchasing,
isLoading: _sendViewModel.state is IsExecutingState ||
cakePayBuyCardViewModel.isPurchasing,
color: Theme.of(context).colorScheme.primary,
textColor: Theme.of(context).colorScheme.onPrimary,
),
@@ -600,7 +598,7 @@ class CakePayBuyCardPage extends BasePage {
profileName: order?.cards.first.cardName ?? 'Cake Pay',
profileImageUrl: order?.cards.first.cardImagePath ?? '',
),
fiatAmount: '${order?.totalReceiveAmount}',
fiatAmount: '${order?.totalReceiveAmount}',
))
.toList();
@@ -613,7 +611,6 @@ class CakePayBuyCardPage extends BasePage {
return ConfirmSendingBottomSheet(
key: ValueKey('cake_pay_buy_page_confirm_sending_dialog_key'),
titleText: S.of(bottomSheetContext).confirm_transaction,
currentTheme: currentTheme,
cakePayBuyCardViewModel: cakePayBuyCardViewModel,
paymentId: S.of(bottomSheetContext).payment_id,
paymentIdValue: cakePayBuyCardViewModel.order?.orderId,
@@ -627,7 +624,7 @@ class CakePayBuyCardPage extends BasePage {
fiatAmountValue: _sendViewModel.pendingTransactionFiatAmountFormatted,
fee: S.of(bottomSheetContext).send_fee,
feeValue: _sendViewModel.pendingTransaction!.feeFormatted,
feeFiatAmount:_sendViewModel.pendingTransactionFeeFiatAmountFormatted,
feeFiatAmount: _sendViewModel.pendingTransactionFeeFiatAmountFormatted,
outputs: displayingOutputs,
footerType: FooterType.slideActionButton,
slideActionButtonText:
@@ -732,7 +729,6 @@ class CakePayBuyCardPage extends BasePage {
context: context,
isDismissible: false,
builder: (BuildContext bottomSheetContext) => InfoBottomSheet(
currentTheme: currentTheme,
footerType: FooterType.singleActionButton,
titleText: S.of(bottomSheetContext).proceed_on_device,
contentImage: 'assets/images/hardware_wallet/ledger_nano_x.png',
+15 -27
View File
@@ -10,13 +10,10 @@ import 'package:cake_wallet/cake_pay/src/widgets/card_item.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/filter_widget.dart';
import 'package:cake_wallet/src/widgets/bottom_sheet/base_bottom_sheet_widget.dart';
import 'package:cake_wallet/src/widgets/bottom_sheet/cake_pay_card_info_bottom_sheet_widget.dart';
import 'package:cake_wallet/src/widgets/cake_scrollbar.dart';
import 'package:cake_wallet/src/widgets/gradient_background.dart';
import 'package:cake_wallet/src/widgets/picker.dart';
import 'package:cake_wallet/src/widgets/tab_view_wrapper_widget.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/typography.dart';
import 'package:cake_wallet/utils/debounce.dart';
import 'package:cake_wallet/utils/feature_flag.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
@@ -94,10 +91,7 @@ class CakePayCardsPage extends BasePage {
@override
Widget body(BuildContext context) {
return CakePayCardsPageBody(
cardsListViewModel: _cardsListViewModel,
currentTheme: currentTheme,
titleColor: titleColor);
return CakePayCardsPageBody(cardsListViewModel: _cardsListViewModel, titleColor: titleColor);
}
}
@@ -105,12 +99,10 @@ class CakePayCardsPageBody extends StatefulWidget {
const CakePayCardsPageBody({
super.key,
required CakePayCardsListViewModel cardsListViewModel,
required this.currentTheme,
required this.titleColor,
}) : _cardsListViewModel = cardsListViewModel;
final CakePayCardsListViewModel _cardsListViewModel;
final MaterialThemeBase currentTheme;
final Color? Function(BuildContext) titleColor;
@override
@@ -188,8 +180,8 @@ class _CakePayCardsPageBodyState extends State<CakePayCardsPageBody> {
],
views: [
_MyCardsTab(
cardsListViewModel: widget._cardsListViewModel,
currentTheme: widget.currentTheme),
cardsListViewModel: widget._cardsListViewModel,
),
_ShopTab(cardsListViewModel: widget._cardsListViewModel)
]),
)
@@ -258,10 +250,9 @@ class _TrailingIcon extends StatelessWidget {
}
class _MyCardsTab extends StatefulWidget {
const _MyCardsTab({required this.cardsListViewModel, required this.currentTheme});
const _MyCardsTab({required this.cardsListViewModel});
final CakePayCardsListViewModel cardsListViewModel;
final MaterialThemeBase currentTheme;
@override
State<_MyCardsTab> createState() => _MyCardsTabState();
@@ -322,18 +313,20 @@ class _MyCardsTabState extends State<_MyCardsTab> {
logoUrl: card.cardImageUrl,
title: card.name,
subTitle: '\$100',
onTap: () => _showCardInfoBottomSheet(context, card, widget.currentTheme),
onTap: () => _showCardInfoBottomSheet(context, card),
);
},
),
],
);
return showThumb ? Scrollbar(
key: ValueKey('cake_pay_my_cards_tab_scrollbar_key'),
thumbVisibility: true,
trackVisibility: true,
child: userCardsList,
) : userCardsList;
return showThumb
? Scrollbar(
key: ValueKey('cake_pay_my_cards_tab_scrollbar_key'),
thumbVisibility: true,
trackVisibility: true,
child: userCardsList,
)
: userCardsList;
}),
),
],
@@ -342,8 +335,7 @@ class _MyCardsTabState extends State<_MyCardsTab> {
}
}
Future<void> _showCardInfoBottomSheet(
BuildContext context, CakePayCard card, MaterialThemeBase currentTheme) async {
Future<void> _showCardInfoBottomSheet(BuildContext context, CakePayCard card) async {
bool isReloadable = false; // TODO: replace with real logic
if (card.name.toLowerCase().contains('prepaid')) {
isReloadable = true;
@@ -360,7 +352,6 @@ Future<void> _showCardInfoBottomSheet(
titleText: 'Reloadable Card',
balance: '100 USD',
howToUse: card.howToUse,
currentTheme: currentTheme,
footerType: FooterType.doubleActionButton,
applyBoxShadow: true,
contentImage: card.cardImageUrl,
@@ -376,7 +367,6 @@ Future<void> _showCardInfoBottomSheet(
titleText: card.name,
balance: '500 USD',
howToUse: card.howToUse,
currentTheme: currentTheme,
footerType: FooterType.singleActionButton,
applyBoxShadow: true,
contentImage: card.cardImageUrl,
@@ -400,7 +390,6 @@ class _ShopTab extends StatefulWidget {
class _ShopTabState extends State<_ShopTab> {
late final ScrollController _scroll;
@override
void initState() {
super.initState();
@@ -466,8 +455,7 @@ class _ShopTabState extends State<_ShopTab> {
return const _Loading();
}
if (vendors.isEmpty)
return Center(child: Text(S.of(context).no_cards_found));
if (vendors.isEmpty) return Center(child: Text(S.of(context).no_cards_found));
final loadingMore = viewModel.isLoadingNextPage;
final showThumb = vendors.length > 3;