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
+1 -1
View File
@@ -72,7 +72,7 @@ abstract class BasePage extends StatelessWidget {
Widget backButton(BuildContext context) => Icon(
Icons.arrow_back_ios,
color: pageIconColor(context),
color: Theme.of(context).colorScheme.primary,
size: 16,
);
+14 -11
View File
@@ -78,11 +78,10 @@ class BuySellPage extends BasePage {
Widget? leading(BuildContext context) {
final _backButton = Icon(
Icons.arrow_back_ios,
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).colorScheme.primary,
size: 16,
);
final _closeButton =
buySellViewModel.isDarkTheme ? closeButtonImageDarkTheme : closeButtonImage;
final _closeButton = currentTheme.isDark ? closeButtonImageDarkTheme : closeButtonImage;
bool isMobileView = responsiveLayoutUtil.shouldRenderMobileUI;
@@ -211,7 +210,7 @@ class BuySellPage extends BasePage {
borderRadius: 30,
padding: EdgeInsets.symmetric(horizontal: 24, vertical: 8),
leadingIcon: Icons.arrow_forward_ios,
isDarkTheme: buySellViewModel.isDarkTheme);
isDarkTheme: currentTheme.isDark);
}
if (buySellViewModel.paymentMethodState is PaymentMethodFailed) {
return OptionTilePlaceholder(errorText: 'No payment methods available', borderRadius: 30);
@@ -225,7 +224,7 @@ class BuySellPage extends BasePage {
title: selectedPaymentMethod.title,
onPressed: () => _pickPaymentMethod(context),
leadingIcon: Icons.arrow_forward_ios,
isLightMode: !buySellViewModel.isDarkTheme,
isLightMode: !currentTheme.isDark,
borderRadius: 30,
padding: EdgeInsets.symmetric(horizontal: 24, vertical: 8),
titleTextStyle: Theme.of(context).textTheme.titleMedium?.copyWith(
@@ -321,8 +320,8 @@ class BuySellPage extends BasePage {
_cryptoAddressFocus.addListener(() async {
if (!_cryptoAddressFocus.hasFocus && cryptoAddressController.text.isNotEmpty) {
final domain = cryptoAddressController.text;
buySellViewModel.cryptoCurrencyAddress =
await fetchParsedAddress(context, domain, buySellViewModel.cryptoCurrency);
buySellViewModel.cryptoCurrencyAddress = await fetchParsedAddress(
context, domain, buySellViewModel.cryptoCurrency);
}
});
@@ -404,7 +403,7 @@ class BuySellPage extends BasePage {
onCurrencySelected: (currency) => buySellViewModel.changeFiatCurrency(currency: currency),
imageArrow: Image.asset(
'assets/images/arrow_bottom_purple_icon.png',
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).colorScheme.primary,
height: 8,
),
currencyButtonColor: Colors.transparent,
@@ -441,7 +440,7 @@ class BuySellPage extends BasePage {
onCurrencySelected: (currency) => buySellViewModel.changeCryptoCurrency(currency: currency),
imageArrow: Image.asset(
'assets/images/arrow_bottom_cake_green.png',
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).colorScheme.primary,
height: 8,
),
currencyButtonColor: Colors.transparent,
@@ -508,8 +507,12 @@ class BuySellPage extends BasePage {
}
Future<String> fetchParsedAddress(
BuildContext context, String domain, CryptoCurrency currency) async {
final parsedAddress = await getIt.get<AddressResolver>().resolve(context, domain, currency);
BuildContext context,
String domain,
CryptoCurrency currency,
) async {
final parsedAddress =
await getIt.get<AddressResolver>().resolve(context, domain, currency);
final address = await extractAddressFromParsed(context, parsedAddress);
return address;
}
@@ -316,7 +316,6 @@ class ConnectDevicePageBodyState extends State<ConnectDevicePageBody> {
isScrollControlled: true,
builder: (BuildContext bottomSheetContext) => InfoStepsBottomSheet(
titleText: S.of(context).how_to_connect,
currentTheme: widget.currentTheme,
steps: [
InfoStep('${S.of(context).step} 1', S.of(context).connect_hw_info_step_1),
InfoStep('${S.of(context).step} 2', S.of(context).connect_hw_info_step_2),
@@ -31,7 +31,7 @@ class _MoneroHardwareWalletOptionsForm extends StatefulWidget {
const _MoneroHardwareWalletOptionsForm(this._walletHardwareRestoreVM);
final WalletHardwareRestoreViewModel _walletHardwareRestoreVM;
@override
_MoneroHardwareWalletOptionsFormState createState() =>
_MoneroHardwareWalletOptionsFormState(_walletHardwareRestoreVM);
@@ -109,7 +109,6 @@ class SelectDeviceManufacturerPage extends BasePage {
arguments: [manufacturer.hardwareWalletType]);
}
},
isDarkTheme: currentTheme.isDark,
),
),
),
@@ -127,7 +126,6 @@ class SelectDeviceManufacturerPage extends BasePage {
onPressed: () =>
Fluttertoast.showToast(msg: 'One more tap and it might work'),
// Ester egg
isDarkTheme: currentTheme.isDark,
isUnavailable: true,
),
),
@@ -1,11 +1,10 @@
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
import 'package:cake_wallet/themes/core/theme_extension.dart';
import 'package:flutter/material.dart';
class ManufacturerOptionTile extends StatelessWidget {
const ManufacturerOptionTile({
required this.onPressed,
required this.image,
required this.isDarkTheme,
this.tag,
this.isUnavailable = false,
});
@@ -14,7 +13,6 @@ class ManufacturerOptionTile extends StatelessWidget {
final Widget image;
final String? tag;
final bool isUnavailable;
final bool isDarkTheme;
@override
Widget build(BuildContext context) => GestureDetector(
@@ -28,12 +26,8 @@ class ManufacturerOptionTile extends StatelessWidget {
borderRadius: BorderRadius.circular(12),
gradient: LinearGradient(
colors: [
isDarkTheme
? CustomThemeColors.cardGradientColorPrimaryDark
: CustomThemeColors.cardGradientColorPrimaryLight,
isDarkTheme
? CustomThemeColors.cardGradientColorSecondaryDark
: CustomThemeColors.cardGradientColorSecondaryLight,
context.customColors.cardGradientColorPrimary,
context.customColors.cardGradientColorSecondary,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
+8 -7
View File
@@ -144,13 +144,14 @@ class ContactPage extends BasePage {
void _presentCurrencyPicker(BuildContext context) {
showPopUp<void>(
builder: (_) => CurrencyPicker(
selectedAtIndex: contactViewModel.currency != null
? contactViewModel.currencies.indexOf(contactViewModel.currency!)
: -1,
items: contactViewModel.currencies,
title: S.of(context).please_select,
hintText: S.of(context).search_currency,
onItemSelected: (Currency item) => contactViewModel.currency = item as CryptoCurrency),
selectedAtIndex: contactViewModel.currency != null
? contactViewModel.currencies.indexOf(contactViewModel.currency!)
: -1,
items: contactViewModel.currencies,
title: S.of(context).please_select,
hintText: S.of(context).search_currency,
onItemSelected: (Currency item) => contactViewModel.currency = item as CryptoCurrency,
),
context: context,
);
}
@@ -174,7 +174,7 @@ class _DashboardPageView extends BasePage {
label: S.of(context).wallet_menu,
child: SvgPicture.asset(
'assets/images/menu.svg',
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).colorScheme.primary,
),
),
),
@@ -262,7 +262,6 @@ class _DashboardPageView extends BasePage {
),
NavigationDock(
dashboardViewModel: dashboardViewModel,
currentTheme: currentTheme,
)
],
),
@@ -30,22 +30,22 @@ class DesktopWalletSelectionDropDown extends StatefulWidget {
}
class _DesktopWalletSelectionDropDownState extends State<DesktopWalletSelectionDropDown> {
final moneroIcon = Image.asset('assets/images/monero_logo.png', height: 24, width: 24);
final bitcoinIcon = Image.asset('assets/images/bitcoin.png', height: 24, width: 24);
final moneroIcon = Image.asset('assets/images/crypto/monero.png', height: 24, width: 24);
final bitcoinIcon = Image.asset('assets/images/crypto/bitcoin.png', height: 24, width: 24);
final tBitcoinIcon = Image.asset('assets/images/tbtc.png', height: 24, width: 24);
final litecoinIcon = Image.asset('assets/images/litecoin_icon.png', height: 24, width: 24);
final litecoinIcon = Image.asset('assets/images/crypto/litecoin.png', height: 24, width: 24);
final havenIcon = Image.asset('assets/images/haven_logo.png', height: 24, width: 24);
final ethereumIcon = Image.asset('assets/images/eth_icon.png', height: 24, width: 24);
final polygonIcon = Image.asset('assets/images/matic_icon.png', height: 24, width: 24);
final bitcoinCashIcon = Image.asset('assets/images/bch_icon.png', height: 24, width: 24);
final nanoIcon = Image.asset('assets/images/nano_icon.png', height: 24, width: 24);
final bananoIcon = Image.asset('assets/images/nano_icon.png', height: 24, width: 24);
final solanaIcon = Image.asset('assets/images/sol_icon.png', height: 24, width: 24);
final tronIcon = Image.asset('assets/images/trx_icon.png', height: 24, width: 24);
final wowneroIcon = Image.asset('assets/images/wownero_icon.png', height: 24, width: 24);
final zanoIcon = Image.asset('assets/images/zano_icon.png', height: 24, width: 24);
final decredIcon = Image.asset('assets/images/decred_icon.png', height: 24, width: 24);
final dogeIcon = Image.asset('assets/images/doge_icon.png', height: 24, width: 24);
final ethereumIcon = Image.asset('assets/images/crypto/ethereum.png', height: 24, width: 24);
final polygonIcon = Image.asset('assets/images/crypto/polygon.png', height: 24, width: 24);
final bitcoinCashIcon = Image.asset('assets/images/crypto/bitcoin-cash.png', height: 24, width: 24);
final nanoIcon = Image.asset('assets/images/crypto/nano.png', height: 24, width: 24);
final bananoIcon = Image.asset('assets/images/crypto/nano.png', height: 24, width: 24);
final solanaIcon = Image.asset('assets/images/crypto/solana.png', height: 24, width: 24);
final tronIcon = Image.asset('assets/images/crypto/tron.png', height: 24, width: 24);
final wowneroIcon = Image.asset('assets/images/crypto/wownero.png', height: 24, width: 24);
final zanoIcon = Image.asset('assets/images/crypto/zano.png', height: 24, width: 24);
final decredIcon = Image.asset('assets/images/crypto/decred.png', height: 24, width: 24);
final dogeIcon = Image.asset('assets/images/crypto/dogecoin.png', height: 24, width: 24);
final nonWalletTypeIcon = Image.asset('assets/images/close.png', height: 24, width: 24);
Image _newWalletImage(BuildContext context) => Image.asset(
+4 -15
View File
@@ -10,8 +10,7 @@ import 'package:cake_wallet/src/widgets/checkbox_widget.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
import 'package:cake_wallet/src/widgets/warning_box_widget.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/show_pop_up.dart';
import 'package:cake_wallet/view_model/dashboard/home_settings_view_model.dart';
import 'package:cw_core/crypto_currency.dart';
@@ -44,7 +43,6 @@ class EditTokenPage extends BasePage {
homeSettingsViewModel: homeSettingsViewModel,
token: token,
initialContractAddress: initialContractAddress,
currentTheme: currentTheme,
);
}
}
@@ -55,13 +53,11 @@ class EditTokenPageBody extends StatefulWidget {
required this.homeSettingsViewModel,
this.token,
this.initialContractAddress,
required this.currentTheme,
}) : super(key: key);
final HomeSettingsViewModel homeSettingsViewModel;
final CryptoCurrency? token;
final String? initialContractAddress;
final MaterialThemeBase currentTheme;
@override
State<EditTokenPageBody> createState() => _EditTokenPageBodyState();
@@ -128,8 +124,7 @@ class _EditTokenPageBodyState extends State<EditTokenPageBody> {
void _checkIfTokenIsVerified(String? contractAddress) {
if (contractAddress == null) return;
final isVerified =
widget.homeSettingsViewModel.checkIfTokenIsWhitelisted(contractAddress);
final isVerified = widget.homeSettingsViewModel.checkIfTokenIsWhitelisted(contractAddress);
if (!mounted) return;
setState(() {
@@ -151,13 +146,10 @@ class _EditTokenPageBodyState extends State<EditTokenPageBody> {
WarningBox(
padding: EdgeInsets.all(16),
content: S.of(context).add_token_warning,
currentTheme: widget.currentTheme,
showBorder: false,
textWeight: FontWeight.w500,
textAlign: TextAlign.start,
textColor: widget.currentTheme.isDark
? CustomThemeColors.warningOutlineColorDark
: CustomThemeColors.warningOutlineColorLight,
textColor: context.customColors.warningOutlineColor,
iconSize: 22,
iconSpacing: 16,
),
@@ -443,12 +435,9 @@ class _EditTokenPageBodyState extends State<EditTokenPageBody> {
? WarningBox(
padding: EdgeInsets.all(16),
content: S.of(context).tokens_strong_warning,
currentTheme: widget.currentTheme,
showBorder: false,
textWeight: FontWeight.w500,
textColor: widget.currentTheme.isDark
? CustomThemeColors.warningOutlineColorDark
: CustomThemeColors.warningOutlineColorLight,
textColor: context.customColors.warningOutlineColor,
showIcon: false,
)
: Text(
@@ -60,7 +60,7 @@ class AddressPage extends BasePage {
Widget? leading(BuildContext context) {
final _backButton = Icon(
Icons.arrow_back_ios,
color: titleColor(context),
color: Theme.of(context).colorScheme.primary,
size: 16,
);
final _closeButton = currentTheme.isDark ? closeButtonImageDarkTheme : closeButtonImage;
@@ -114,7 +114,7 @@ class AddressPage extends BasePage {
context: context,
);
},
icon: Icon(Icons.share, size: 20, color: pageIconColor(context)),
icon: Icon(Icons.share, size: 20, color: Theme.of(context).colorScheme.primary),
),
),
);
@@ -150,7 +150,6 @@ class AddressPage extends BasePage {
addressListViewModel: addressListViewModel,
amountTextFieldFocusNode: _cryptoAmountFocus,
amountController: _amountController,
currentTheme: dashboardViewModel.appStore.themeStore.currentTheme,
),
),
),
@@ -6,7 +6,7 @@ import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/exchange_trade/information_page.dart';
import 'package:cake_wallet/src/widgets/cake_image_widget.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/payment_request.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
@@ -71,22 +71,20 @@ class BalanceRowWidget extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(15.0),
gradient: LinearGradient(
colors: [
dashboardViewModel.isDarkTheme
? CustomThemeColors.cardGradientColorPrimaryDark
: CustomThemeColors.cardGradientColorPrimaryLight,
dashboardViewModel.isDarkTheme
? CustomThemeColors.cardGradientColorSecondaryDark
: CustomThemeColors.cardGradientColorSecondaryLight,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
colors: [
context.customColors.cardGradientColorPrimary,
context.customColors.cardGradientColorSecondary,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
),
child: TextButton(
onPressed: _showToast,
onLongPress: () => dashboardViewModel.balanceViewModel.switchBalanceValue(),
style: TextButton.styleFrom(
side: BorderSide(
width: 1.25, color: Theme.of(context).colorScheme.surfaceContainerHigh),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
),
child: Container(
@@ -328,12 +326,8 @@ class BalanceRowWidget extends StatelessWidget {
borderRadius: BorderRadius.circular(15),
gradient: LinearGradient(
colors: [
dashboardViewModel.isDarkTheme
? CustomThemeColors.cardGradientColorPrimaryDark
: CustomThemeColors.cardGradientColorPrimaryLight,
dashboardViewModel.isDarkTheme
? CustomThemeColors.cardGradientColorSecondaryDark
: CustomThemeColors.cardGradientColorSecondaryLight,
context.customColors.cardGradientColorPrimary,
context.customColors.cardGradientColorSecondary,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
@@ -531,7 +525,8 @@ class BalanceRowWidget extends StatelessWidget {
style: OutlinedButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.primary,
side: BorderSide(
color: Theme.of(context).colorScheme.outlineVariant.withAlpha(0),
color:
Theme.of(context).colorScheme.outlineVariant.withAlpha(0),
width: 0,
),
shape: RoundedRectangleBorder(
@@ -588,7 +583,8 @@ class BalanceRowWidget extends StatelessWidget {
style: OutlinedButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.surface,
side: BorderSide(
color: Theme.of(context).colorScheme.outlineVariant.withAlpha(0),
color:
Theme.of(context).colorScheme.outlineVariant.withAlpha(0),
width: 0,
),
shape: RoundedRectangleBorder(
@@ -9,6 +9,7 @@ import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/src/widgets/dashboard_card_widget.dart';
import 'package:cake_wallet/src/widgets/introducing_card.dart';
import 'package:cake_wallet/src/widgets/standard_switch.dart';
import 'package:cake_wallet/themes/core/theme_extension.dart';
import 'package:cake_wallet/utils/feature_flag.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
@@ -57,7 +58,6 @@ class CryptoBalanceWidget extends StatelessWidget {
return Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
child: DashBoardRoundedCardWidget(
isDarkTheme: dashboardViewModel.isDarkTheme,
title: "Invalid monero bindings",
subTitle: dashboardViewModel.getMoneroError.toString(),
),
@@ -72,7 +72,6 @@ class CryptoBalanceWidget extends StatelessWidget {
return Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
child: DashBoardRoundedCardWidget(
isDarkTheme: dashboardViewModel.isDarkTheme,
title: "Invalid wownero bindings",
subTitle: dashboardViewModel.getWowneroError.toString(),
),
@@ -157,7 +156,6 @@ class CryptoBalanceWidget extends StatelessWidget {
return Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
child: DashBoardRoundedCardWidget(
isDarkTheme: dashboardViewModel.isDarkTheme,
title: S.of(context).rep_warning,
subTitle: S.of(context).rep_warning_sub,
onTap: () => Navigator.of(context).pushNamed(Routes.changeRep),
@@ -220,7 +218,6 @@ class CryptoBalanceWidget extends StatelessWidget {
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
child: DashBoardRoundedCardWidget(
isDarkTheme: dashboardViewModel.isDarkTheme,
customBorder: 30,
title: "This wallet has encountered an issue",
subTitle: "Here are the things that you should note:\n - " +
@@ -233,7 +230,6 @@ class CryptoBalanceWidget extends StatelessWidget {
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 0),
child: DashBoardRoundedCardWidget(
isDarkTheme: dashboardViewModel.isDarkTheme,
shadowBlur: dashboardViewModel.getShadowBlur(),
shadowSpread: dashboardViewModel.getShadowSpread(),
marginV: 0,
@@ -285,7 +281,7 @@ class CryptoBalanceWidget extends StatelessWidget {
],
),
onTap: () => _toggleSilentPaymentsScanning(context),
image: !dashboardViewModel.appStore.themeStore.currentTheme.isDark
image: !context.currentTheme.isDark
? Image.asset(btcLockLight, height: 48)
: Image.asset(btcLockDark, height: 48),
),
@@ -296,7 +292,6 @@ class CryptoBalanceWidget extends StatelessWidget {
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
child: InfoCard(
isDarkTheme: dashboardViewModel.isDarkTheme,
title: S.of(context).litecoin_mweb,
description: S.of(context).litecoin_mweb_description,
leftButtonTitle: S.of(context).litecoin_mweb_dismiss,
@@ -327,7 +322,6 @@ class CryptoBalanceWidget extends StatelessWidget {
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
child: InfoCard(
isDarkTheme: dashboardViewModel.isDarkTheme,
title: S.of(context).synchronizing,
description: S.of(context).decred_info_card_details,
image: 'assets/images/dcr_icon.png',
@@ -344,7 +338,6 @@ class CryptoBalanceWidget extends StatelessWidget {
Padding(
padding: const EdgeInsets.fromLTRB(16, 0, 16, 8),
child: InfoCard(
isDarkTheme: dashboardViewModel.isDarkTheme,
title: "Payjoin",
description: S.of(context).payjoin_card_content,
hintWidget: GestureDetector(
@@ -40,7 +40,6 @@ class CakeFeaturesPage extends StatelessWidget {
children: <Widget>[
SizedBox(height: 2),
DashBoardRoundedCardWidget(
isDarkTheme: dashboardViewModel.isDarkTheme,
shadowBlur: dashboardViewModel.getShadowBlur(),
shadowSpread: dashboardViewModel.getShadowSpread(),
onTap: () {
@@ -53,16 +52,15 @@ class CakeFeaturesPage extends StatelessWidget {
title: 'Cake Pay',
subTitle: S.of(context).cake_pay_subtitle,
image: Image.asset(
'assets/images/cards.png',
height: 100,
width: 115,
'assets/images/cakepay.png',
height: 74,
width: 70,
fit: BoxFit.cover,
),
),
Observer(builder: (_) {
if (dashboardViewModel.type == WalletType.ethereum) {
return DashBoardRoundedCardWidget(
isDarkTheme: dashboardViewModel.isDarkTheme,
shadowBlur: dashboardViewModel.getShadowBlur(),
shadowSpread: dashboardViewModel.getShadowSpread(),
onTap: () => Navigator.of(context).pushNamed(Routes.dEuroSavings),
@@ -80,7 +78,6 @@ class CakeFeaturesPage extends StatelessWidget {
return const SizedBox();
}),
DashBoardRoundedCardWidget(
isDarkTheme: dashboardViewModel.isDarkTheme,
shadowBlur: dashboardViewModel.getShadowBlur(),
shadowSpread: dashboardViewModel.getShadowSpread(),
onTap: () => _launchUrl("cake.nano-gpt.com"),
@@ -1,7 +1,6 @@
import 'dart:ui';
import 'package:cake_wallet/entities/main_actions.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:flutter/material.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
import 'package:cake_wallet/src/screens/dashboard/widgets/action_button.dart';
@@ -10,11 +9,9 @@ import 'package:flutter_mobx/flutter_mobx.dart';
class NavigationDock extends StatelessWidget {
const NavigationDock({
required this.dashboardViewModel,
required this.currentTheme,
});
final DashboardViewModel dashboardViewModel;
final MaterialThemeBase currentTheme;
@override
Widget build(BuildContext context) {
@@ -24,13 +21,15 @@ class NavigationDock extends StatelessWidget {
return Container(
height: 150,
alignment: Alignment.bottomCenter,
decoration: dashboardViewModel.settingsStore.backgroundImage.isEmpty ? BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: _getColors(context, !currentTheme.isDark),
),
) : null,
decoration: dashboardViewModel.settingsStore.backgroundImage.isEmpty
? BoxDecoration(
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: _getColors(context),
),
)
: null,
//color: Colors.transparent,
child: Container(
decoration: BoxDecoration(
@@ -38,7 +37,7 @@ class NavigationDock extends StatelessWidget {
gradient: LinearGradient(
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
colors: _getColors(context, !currentTheme.isDark),
colors: _getColors(context),
),
),
margin: const EdgeInsets.only(left: 8, right: 8, bottom: 16),
@@ -95,25 +94,15 @@ class NavigationDock extends StatelessWidget {
);
}
List<Color> _getColors(BuildContext context, bool isBright) {
return isBright
? <Color>[
CustomThemeColors.backgroundGradientColorLight.withAlpha(5),
CustomThemeColors.backgroundGradientColorLight.withAlpha(50),
CustomThemeColors.backgroundGradientColorLight.withAlpha(125),
CustomThemeColors.backgroundGradientColorLight.withAlpha(150),
CustomThemeColors.backgroundGradientColorLight.withAlpha(200),
CustomThemeColors.backgroundGradientColorLight,
CustomThemeColors.backgroundGradientColorLight
]
: <Color>[
CustomThemeColors.backgroundGradientColorDark.withAlpha(5),
CustomThemeColors.backgroundGradientColorDark.withAlpha(50),
CustomThemeColors.backgroundGradientColorDark.withAlpha(125),
CustomThemeColors.backgroundGradientColorDark.withAlpha(150),
CustomThemeColors.backgroundGradientColorDark.withAlpha(200),
CustomThemeColors.backgroundGradientColorDark,
CustomThemeColors.backgroundGradientColorDark
];
List<Color> _getColors(BuildContext context) {
return <Color>[
context.customColors.backgroundGradientColor.withAlpha(5),
context.customColors.backgroundGradientColor.withAlpha(50),
context.customColors.backgroundGradientColor.withAlpha(125),
context.customColors.backgroundGradientColor.withAlpha(150),
context.customColors.backgroundGradientColor.withAlpha(200),
context.customColors.backgroundGradientColor,
context.customColors.backgroundGradientColor,
];
}
}
@@ -232,19 +232,19 @@ class _NFTSingleInfoTile extends StatelessWidget {
Text(
infoType,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
fontWeight: FontWeight.w500,
height: 1,
),
color: Theme.of(context).colorScheme.onSurfaceVariant,
fontWeight: FontWeight.w500,
height: 1,
),
),
const SizedBox(height: 8),
Text(
infoValue,
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontWeight: FontWeight.w600,
color: Theme.of(context).colorScheme.onSurface,
height: 1,
),
fontWeight: FontWeight.w600,
color: Theme.of(context).colorScheme.onSurface,
height: 1,
),
),
],
),
@@ -49,7 +49,6 @@ class TransactionsPage extends StatelessWidget {
final status = dashboardViewModel.status;
if (status is SyncingSyncStatus) {
return DashBoardRoundedCardWidget(
isDarkTheme: dashboardViewModel.isDarkTheme,
key: ValueKey('transactions_page_syncing_alert_card_key'),
onTap: () {
try {
@@ -12,14 +12,12 @@ class HomeScreenAccountWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
return GestureDetector(
onTap: () async {
await showPopUp<void>(
context: context,
builder: (_) => getIt.get<MoneroAccountListPage>());
},
onTap: () async {
await showPopUp<void>(context: context, builder: (_) => getIt.get<MoneroAccountListPage>());
},
behavior: HitTestBehavior.opaque,
child: Padding(
padding: EdgeInsets.only(top: 25, bottom: 25, left: 25, right: 0),
padding: EdgeInsets.all(25.0),
child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
@@ -32,31 +30,36 @@ class HomeScreenAccountWidget extends StatelessWidget {
child: Text(
walletName ?? '',
style: Theme.of(context).textTheme.headlineSmall?.copyWith(
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onSurface,
),
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onSurface,
),
),
),
SizedBox(
height: 5.0,
),
Container(
child: Text(
accountName ?? '',
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onSurfaceVariant,
Row(
children: [
Padding(padding: EdgeInsets.only(left: 20)),
Container(
child: Text(
accountName ?? '',
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.primary,
),
),
),
),
Container(
child: Icon(
Icons.keyboard_arrow_down,
color: Theme.of(context).colorScheme.primary,
),
),
],
),
],
),
Container(
child: Icon(
Icons.keyboard_arrow_down,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
],
),
),
@@ -8,14 +8,13 @@ class InfoCard extends StatelessWidget {
final String title;
final String description;
final String image;
final bool isDarkTheme;
final Function() leftButtonAction;
final Function() rightButtonAction;
final Widget? hintWidget;
const InfoCard({
Key? key,
super.key,
required this.title,
required this.description,
required this.leftButtonTitle,
@@ -23,14 +22,12 @@ class InfoCard extends StatelessWidget {
required this.leftButtonAction,
required this.rightButtonAction,
required this.image,
required this.isDarkTheme,
this.hintWidget,
}) : super(key: key);
});
@override
Widget build(BuildContext context) {
return DashBoardRoundedCardWidget(
isDarkTheme: isDarkTheme,
marginH: 0,
marginV: 0,
customBorder: 30,
@@ -24,21 +24,21 @@ class MenuWidgetState extends State<MenuWidget> {
this.tileHeight = 60,
this.fromTopEdge = 50,
this.fromBottomEdge = 25,
this.moneroIcon = Image.asset('assets/images/monero_menu.png'),
this.bitcoinIcon = Image.asset('assets/images/bitcoin_menu.png'),
this.litecoinIcon = Image.asset('assets/images/litecoin_menu.png'),
this.moneroIcon = Image.asset('assets/images/crypto/monero.png'),
this.bitcoinIcon = Image.asset('assets/images/crypto/bitcoin.png'),
this.litecoinIcon = Image.asset('assets/images/crypto/litecoin.png'),
this.havenIcon = Image.asset('assets/images/haven_menu.png'),
this.ethereumIcon = Image.asset('assets/images/eth_icon.png'),
this.nanoIcon = Image.asset('assets/images/nano_icon.png'),
this.bananoIcon = Image.asset('assets/images/nano_icon.png'),
this.bitcoinCashIcon = Image.asset('assets/images/bch_icon.png'),
this.polygonIcon = Image.asset('assets/images/matic_icon.png'),
this.solanaIcon = Image.asset('assets/images/sol_icon.png'),
this.tronIcon = Image.asset('assets/images/trx_icon.png'),
this.wowneroIcon = Image.asset('assets/images/wownero_icon.png'),
this.zanoIcon = Image.asset('assets/images/zano_icon.png'),
this.decredIcon = Image.asset('assets/images/decred_menu.png'),
this.dogecoinIcon = Image.asset('assets/images/doge_icon.png');
this.ethereumIcon = Image.asset('assets/images/crypto/ethereum.png'),
this.nanoIcon = Image.asset('assets/images/crypto/nano.png'),
this.bananoIcon = Image.asset('assets/images/crypto/nano.png'),
this.bitcoinCashIcon = Image.asset('assets/images/crypto/bitcoin-cash.png'),
this.polygonIcon = Image.asset('assets/images/crypto/polygon.png'),
this.solanaIcon = Image.asset('assets/images/crypto/solana.png'),
this.tronIcon = Image.asset('assets/images/crypto/tron.png'),
this.wowneroIcon = Image.asset('assets/images/crypto/wownero.png'),
this.zanoIcon = Image.asset('assets/images/crypto/zano.png'),
this.decredIcon = Image.asset('assets/images/crypto/decred.png'),
this.dogecoinIcon = Image.asset('assets/images/crypto/dogecoin.png');
final largeScreen = 731;
@@ -114,10 +114,8 @@ class MenuWidgetState extends State<MenuWidget> {
}
int itemCount = items.length;
moneroIcon =
Image.asset('assets/images/monero_menu.png', color: Theme.of(context).colorScheme.primary);
bitcoinIcon =
Image.asset('assets/images/bitcoin_menu.png', color: Theme.of(context).colorScheme.primary);
moneroIcon = Image.asset('assets/images/crypto/monero.png');
bitcoinIcon = Image.asset('assets/images/crypto/bitcoin.png');
return Row(
mainAxisSize: MainAxisSize.max,
@@ -18,59 +18,65 @@ class PresentReceiveOptionPicker extends StatelessWidget {
Widget build(BuildContext context) {
final arrowBottom = Image.asset(
'assets/images/arrow_bottom_purple_icon.png',
color: color,
color: Theme.of(context).colorScheme.primary,
height: 6,
);
return TextButton(
onPressed: () => _showPicker(context),
style: ButtonStyle(
padding: WidgetStateProperty.all(EdgeInsets.zero),
splashFactory: NoSplash.splashFactory,
foregroundColor: WidgetStateProperty.all(Colors.transparent),
overlayColor: WidgetStateProperty.all(Colors.transparent),
),
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.center,
return Padding(
padding: EdgeInsets.only(left: 6),
child: TextButton(
onPressed: () => _showPicker(context),
style: ButtonStyle(
padding: WidgetStateProperty.all(EdgeInsets.zero),
splashFactory: NoSplash.splashFactory,
foregroundColor: WidgetStateProperty.all(Colors.transparent),
overlayColor: WidgetStateProperty.all(Colors.transparent),
),
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
S.current.receive,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 17.0,
fontWeight: FontWeight.bold,
color: color,
),
),
Observer(
builder: (_) => Text(
receiveOptionViewModel.selectedReceiveOption
.toString()
.replaceAll(RegExp(r'silent payments', caseSensitive: false),
S.current.silent_payments)
.replaceAll(
RegExp(r'default', caseSensitive: false), S.current.string_default),
style: Theme.of(context).textTheme.bodySmall!.copyWith(
fontSize: 10.0,
fontWeight: FontWeight.w500,
color: color,
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
S.current.receive,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 17.0,
fontWeight: FontWeight.bold,
color: Theme.of(context).colorScheme.onSurface,
),
),
Row(
children: [
Observer(
builder: (_) => Text(
receiveOptionViewModel.selectedReceiveOption
.toString()
.replaceAll(RegExp(r'silent payments', caseSensitive: false),
S.current.silent_payments)
.replaceAll(RegExp(r'default', caseSensitive: false),
S.current.string_default),
style: Theme.of(context).textTheme.bodySmall!.copyWith(
fontSize: 10.0,
fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
),
),
],
),
],
),
SizedBox(width: 5),
Padding(
padding: EdgeInsets.only(top: 12),
child: arrowBottom,
)
],
),
SizedBox(width: 5),
Padding(
padding: EdgeInsets.only(top: 12),
child: arrowBottom,
)
],
),
);
));
}
void _showPicker(BuildContext context) async {
@@ -1,10 +1,14 @@
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
import 'package:cake_wallet/themes/core/custom_theme_colors.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/svg.dart';
class SyncIndicatorIcon extends StatelessWidget {
SyncIndicatorIcon(
{this.boolMode = true, this.isSynced = false, this.value = waiting, this.size = 6.0, this.showTorIcon = false});
{this.boolMode = true,
this.isSynced = false,
this.value = waiting,
this.size = 6.0,
this.showTorIcon = false});
final bool boolMode;
final bool isSynced;
@@ -25,9 +29,7 @@ class SyncIndicatorIcon extends StatelessWidget {
Color indicatorColor;
if (boolMode) {
indicatorColor = isSynced
? CustomThemeColors.syncGreen
: CustomThemeColors.syncYellow;
indicatorColor = isSynced ? CustomThemeColors.syncGreen : CustomThemeColors.syncYellow;
} else {
switch (value.toLowerCase()) {
case actionRequired:
@@ -48,14 +50,18 @@ class SyncIndicatorIcon extends StatelessWidget {
return Container(
height: size,
width: size,
decoration: showTorIcon ? null : BoxDecoration(
shape: BoxShape.circle,
color: indicatorColor,
),
child: showTorIcon ? SvgPicture.asset(
"assets/images/tor.svg",
color: indicatorColor,
) : null,
decoration: showTorIcon
? null
: BoxDecoration(
shape: BoxShape.circle,
color: indicatorColor,
),
child: showTorIcon
? SvgPicture.asset(
"assets/images/tor.svg",
color: indicatorColor,
)
: null,
);
}
}
@@ -206,7 +206,7 @@ class ExchangeCardState<T extends Currency> extends State<ExchangeCard<T>> {
style: Theme.of(context).textTheme.titleLarge!.copyWith(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Theme.of(context).colorScheme.onSurfaceVariant
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
)
],
@@ -281,7 +281,7 @@ class ExchangeCardState<T extends Currency> extends State<ExchangeCard<T>> {
S.of(context).refund_address,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurfaceVariant
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
)
@@ -37,7 +37,7 @@ class MobileExchangeCardsSection extends StatelessWidget {
bottomLeft: Radius.circular(24),
bottomRight: Radius.circular(24),
),
color: Theme.of(context).colorScheme.surfaceContainerHighest,
color: Theme.of(context).colorScheme.surfaceContainerHigh,
),
padding: EdgeInsets.fromLTRB(24, 105, 24, 24),
child: Column(
@@ -15,55 +15,58 @@ class PresentProviderPicker extends StatelessWidget {
Widget build(BuildContext context) {
final arrowBottom = Image.asset(
'assets/images/arrow_bottom_purple_icon.png',
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).colorScheme.primary,
height: 6,
);
return TextButton(
onPressed: () => presentProviderPicker(context),
style: ButtonStyle(
padding: WidgetStateProperty.all(EdgeInsets.zero),
splashFactory: NoSplash.splashFactory,
foregroundColor: WidgetStateProperty.all(Colors.transparent),
overlayColor: WidgetStateProperty.all(Colors.transparent),
),
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
S.of(context).swap,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontSize: 16.0,
fontWeight: FontWeight.w600,
),
),
Observer(
builder: (_) => Text(
exchangeViewModel.selectedProviders.isEmpty
? S.of(context).choose_one
: exchangeViewModel.selectedProviders.length > 1
? S.of(context).automatic
: exchangeViewModel.selectedProviders.first.title,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
fontSize: 10.0,
fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurfaceVariant,
return Padding(
padding: EdgeInsets.only(left: 10),
child: TextButton(
onPressed: () => presentProviderPicker(context),
style: ButtonStyle(
padding: WidgetStateProperty.all(EdgeInsets.zero),
splashFactory: NoSplash.splashFactory,
foregroundColor: WidgetStateProperty.all(Colors.transparent),
overlayColor: WidgetStateProperty.all(Colors.transparent),
),
child: Row(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Text(
S.of(context).swap,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontSize: 16.0,
fontWeight: FontWeight.w600,
),
),
)
],
),
SizedBox(width: 5),
Padding(
padding: EdgeInsets.only(top: 12),
child: arrowBottom,
)
],
Observer(
builder: (_) => Text(
exchangeViewModel.selectedProviders.isEmpty
? S.of(context).choose_one
: exchangeViewModel.selectedProviders.length > 1
? S.of(context).automatic
: exchangeViewModel.selectedProviders.first.title,
style: Theme.of(context).textTheme.bodySmall?.copyWith(
fontSize: 10.0,
fontWeight: FontWeight.w500,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
)
],
),
SizedBox(width: 5),
Padding(
padding: EdgeInsets.only(top: 12),
child: arrowBottom,
)
],
),
),
);
}
@@ -114,7 +114,6 @@ class ExchangeTradeExternalSendPage extends BasePage {
(item) => TradeItemRowWidget(
key: ValueKey(
'exchange_trade_external_send_page_send_item_${item.title}_key'),
currentTheme: currentTheme,
title: item.title,
value: item.data,
isCopied: true,
@@ -6,7 +6,6 @@ import 'package:cake_wallet/src/screens/exchange_trade/widgets/exchange_trade_ca
import 'package:cake_wallet/src/widgets/bottom_sheet/base_bottom_sheet_widget.dart';
import 'package:cake_wallet/src/widgets/bottom_sheet/confirm_sending_bottom_sheet_widget.dart';
import 'package:cake_wallet/src/widgets/bottom_sheet/info_bottom_sheet_widget.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/utils/request_review_handler.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:mobx/mobx.dart';
@@ -87,20 +86,13 @@ class ExchangeTradePage extends BasePage {
}
@override
Widget body(BuildContext context) => ExchangeTradeForm(
exchangeTradeViewModel,
currentTheme,
);
Widget body(BuildContext context) => ExchangeTradeForm(exchangeTradeViewModel);
}
class ExchangeTradeForm extends StatefulWidget {
ExchangeTradeForm(
this.exchangeTradeViewModel,
this.currentTheme,
);
ExchangeTradeForm(this.exchangeTradeViewModel);
final ExchangeTradeViewModel exchangeTradeViewModel;
final MaterialThemeBase currentTheme;
@override
ExchangeTradeState createState() => ExchangeTradeState();
@@ -162,7 +154,6 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
: Offstage(),
_ExchangeTradeItemsCardSection(
viewModel: widget.exchangeTradeViewModel,
currentTheme: widget.currentTheme,
),
],
);
@@ -282,7 +273,6 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
builder: (BuildContext bottomSheetContext) {
return ConfirmSendingBottomSheet(
key: ValueKey('exchange_trade_page_confirm_sending_bottom_sheet_key'),
currentTheme: widget.currentTheme,
footerType: FooterType.slideActionButton,
walletType: widget.exchangeTradeViewModel.sendViewModel.walletType,
titleText: S.of(bottomSheetContext).confirm_transaction,
@@ -329,7 +319,6 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
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',
@@ -359,24 +348,18 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
}
class _ExchangeTradeItemsCardSection extends StatelessWidget {
const _ExchangeTradeItemsCardSection({
required this.viewModel,
required this.currentTheme,
});
const _ExchangeTradeItemsCardSection({required this.viewModel});
final ExchangeTradeViewModel viewModel;
final MaterialThemeBase currentTheme;
@override
Widget build(BuildContext context) {
final firstExchangeCard = ExchangeTradeCardItemWidget(
currentTheme: currentTheme,
isReceiveDetailsCard: true,
exchangeTradeViewModel: viewModel,
);
final secondExchangeCard = ExchangeTradeCardItemWidget(
currentTheme: currentTheme,
isReceiveDetailsCard: false,
exchangeTradeViewModel: viewModel,
);
@@ -4,7 +4,6 @@ import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/widgets/alert_with_two_actions.dart';
import 'package:cake_wallet/src/widgets/list_row.dart';
import 'package:cake_wallet/src/widgets/picker.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/utils/show_bar.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/exchange/exchange_trade_view_model.dart';
@@ -20,7 +19,6 @@ class ExchangeTradeCardItemWidget extends StatelessWidget {
ExchangeTradeCardItemWidget({
required this.isReceiveDetailsCard,
required this.exchangeTradeViewModel,
required this.currentTheme,
Key? key,
}) : feesViewModel = exchangeTradeViewModel.feesViewModel,
output = exchangeTradeViewModel.output;
@@ -29,7 +27,6 @@ class ExchangeTradeCardItemWidget extends StatelessWidget {
final bool isReceiveDetailsCard;
final FeesViewModel feesViewModel;
final ExchangeTradeViewModel exchangeTradeViewModel;
final MaterialThemeBase currentTheme;
@override
Widget build(BuildContext context) {
@@ -51,7 +48,6 @@ class ExchangeTradeCardItemWidget extends StatelessWidget {
.where((item) => item.isReceiveDetail == isReceiveDetailsCard)
.map(
(item) => TradeItemRowWidget(
currentTheme: currentTheme,
title: item.title,
value: item.data,
isCopied: item.isCopied,
@@ -151,14 +147,12 @@ class TradeItemRowWidget extends StatelessWidget {
final String value;
final bool isCopied;
final Image copyImage;
final MaterialThemeBase currentTheme;
const TradeItemRowWidget({
required this.title,
required this.value,
required this.isCopied,
required this.copyImage,
required this.currentTheme,
super.key,
});
@@ -55,7 +55,6 @@ class DEuroSavingsPage extends BasePage {
children: <Widget>[
Observer(
builder: (_) => SavingsCard(
isDarkTheme: currentTheme.isDark,
interestRate: "${_dEuroViewModel.interestRateFormated}%",
savingsBalance: _dEuroViewModel.savingsBalanceFormated,
fiatSavingsBalance: _dEuroViewModel.fiatSavingsBalanceFormated,
@@ -71,7 +70,6 @@ class DEuroSavingsPage extends BasePage {
),
Observer(
builder: (_) => InterestCardWidget(
isDarkTheme: currentTheme.isDark,
title: S.of(context).deuro_savings_collect_interest,
fiatAccruedInterest: _dEuroViewModel.fiatAccruedInterestFormated,
fiatCurrency: _dEuroViewModel.isFiatDisabled ? null : _dEuroViewModel.fiat,
@@ -178,7 +176,6 @@ class DEuroSavingsPage extends BasePage {
key: ValueKey('savings_page_confirm_sending_dialog_key'),
footerType: FooterType.slideActionButton,
titleText: title,
currentTheme: currentTheme,
walletType: WalletType.ethereum,
titleIconPath: CryptoCurrency.deuro.iconPath,
currency: CryptoCurrency.deuro,
@@ -214,7 +211,6 @@ class DEuroSavingsPage extends BasePage {
key: ValueKey('savings_page_confirm_approval_dialog_key'),
footerType: FooterType.slideActionButton,
titleText: S.of(bottomSheetContext).approve_tokens,
currentTheme: currentTheme,
walletType: WalletType.ethereum,
titleIconPath: CryptoCurrency.deuro.iconPath,
currency: CryptoCurrency.deuro,
@@ -247,7 +243,6 @@ class DEuroSavingsPage extends BasePage {
isDismissible: false,
builder: (BuildContext bottomSheetContext) => InfoBottomSheet(
footerType: FooterType.singleActionButton,
currentTheme: currentTheme,
titleText: S.of(bottomSheetContext).transaction_sent,
contentImage: 'assets/images/birthday_cake.png',
content: S.of(bottomSheetContext).deuro_tx_commited_content,
@@ -311,7 +306,6 @@ class DEuroSavingsPage extends BasePage {
showModalBottomSheet<void>(
context: context,
builder: (BuildContext bottomSheetContext) => TooltipSheet(
currentTheme: currentTheme,
titleText: title,
titleIconPath: CryptoCurrency.deuro.iconPath,
tooltip: content,
@@ -333,7 +327,6 @@ class DEuroSavingsPage extends BasePage {
context: context,
isScrollControlled: true,
builder: (BuildContext bottomSheetContext) => InfoBottomSheet(
currentTheme: currentTheme,
height: 350,
titleText: "dEURO",
titleIconPath: CryptoCurrency.deuro.iconPath,
@@ -360,7 +353,6 @@ class DEuroSavingsPage extends BasePage {
return showModalBottomSheet<void>(
context: context,
builder: (BuildContext bottomSheetContext) => InfoBottomSheet(
currentTheme: currentTheme,
titleText: title,
titleIconPath: CryptoCurrency.deuro.iconPath,
contentImage: 'assets/images/deuro_not_enough_eth.png',
@@ -1,7 +1,7 @@
import 'package:cake_wallet/entities/fiat_currency.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/integrations/deuro/widgets/savings_card_widget.dart';
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
import 'package:cake_wallet/themes/core/theme_extension.dart';
import 'package:cw_core/crypto_currency.dart';
import 'package:flutter/material.dart';
@@ -9,7 +9,6 @@ class InterestCardWidget extends StatelessWidget {
const InterestCardWidget({
required this.title,
required this.accruedInterest,
required this.isDarkTheme,
required this.isEnabled,
required this.onCollectInterest,
required this.onReinvestInterest,
@@ -22,7 +21,6 @@ class InterestCardWidget extends StatelessWidget {
final String accruedInterest;
final String? fiatAccruedInterest;
final FiatCurrency? fiatCurrency;
final bool isDarkTheme;
final bool isEnabled;
final VoidCallback onCollectInterest;
final VoidCallback onReinvestInterest;
@@ -37,12 +35,8 @@ class InterestCardWidget extends StatelessWidget {
borderRadius: BorderRadius.circular(15),
gradient: LinearGradient(
colors: [
isDarkTheme
? CustomThemeColors.cardGradientColorPrimaryDark
: CustomThemeColors.cardGradientColorPrimaryLight,
isDarkTheme
? CustomThemeColors.cardGradientColorSecondaryDark
: CustomThemeColors.cardGradientColorSecondaryLight,
context.customColors.cardGradientColorPrimary,
context.customColors.cardGradientColorSecondary,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
@@ -52,16 +46,14 @@ class InterestCardWidget extends StatelessWidget {
padding: EdgeInsets.all(20),
child: Column(
children: [
SavingsCard.getAssetBalanceRow(
context,
title: title,
amount: accruedInterest,
fiatAmount: fiatAccruedInterest,
currency: CryptoCurrency.deuro,
fiatCurrency: fiatCurrency,
hideSymbol: false,
onTooltipPressed: onTooltipPressed
),
SavingsCard.getAssetBalanceRow(context,
title: title,
amount: accruedInterest,
fiatAmount: fiatAccruedInterest,
currency: CryptoCurrency.deuro,
fiatCurrency: fiatCurrency,
hideSymbol: false,
onTooltipPressed: onTooltipPressed),
SizedBox(height: 10),
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [
Expanded(
@@ -4,28 +4,14 @@ import 'package:auto_size_text/auto_size_text.dart';
import 'package:cake_wallet/entities/fiat_currency.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
import 'package:cake_wallet/themes/core/theme_extension.dart';
import 'package:cw_core/crypto_currency.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class SavingsCard extends StatelessWidget {
final bool isDarkTheme;
final bool isEnabled;
final bool isLoading;
final String interestRate;
final String savingsBalance;
final String? fiatSavingsBalance;
final FiatCurrency? fiatCurrency;
final CryptoCurrency currency;
final VoidCallback onAddSavingsPressed;
final VoidCallback onRemoveSavingsPressed;
final VoidCallback onApproveSavingsPressed;
final VoidCallback onTooltipPressed;
const SavingsCard({
super.key,
required this.isDarkTheme,
required this.interestRate,
required this.savingsBalance,
required this.currency,
@@ -39,6 +25,18 @@ class SavingsCard extends StatelessWidget {
this.fiatCurrency,
});
final bool isEnabled;
final bool isLoading;
final String interestRate;
final String savingsBalance;
final String? fiatSavingsBalance;
final FiatCurrency? fiatCurrency;
final CryptoCurrency currency;
final VoidCallback onAddSavingsPressed;
final VoidCallback onRemoveSavingsPressed;
final VoidCallback onApproveSavingsPressed;
final VoidCallback onTooltipPressed;
@override
Widget build(BuildContext context) => Container(
margin: const EdgeInsets.all(15),
@@ -77,12 +75,8 @@ class SavingsCard extends StatelessWidget {
borderRadius: BorderRadius.circular(15),
gradient: LinearGradient(
colors: [
isDarkTheme
? CustomThemeColors.cardGradientColorPrimaryDark
: CustomThemeColors.cardGradientColorPrimaryLight,
isDarkTheme
? CustomThemeColors.cardGradientColorSecondaryDark
: CustomThemeColors.cardGradientColorSecondaryLight,
context.customColors.cardGradientColorPrimary,
context.customColors.cardGradientColorSecondary,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
@@ -65,9 +65,8 @@ class _AdvancedPrivacySettingsBody extends StatefulWidget {
this.toggleUseTestnet,
this.privacySettingsViewModel,
this.nodeViewModel,
this.seedTypeViewModel, {
Key? key,
}) : super(key: key);
this.seedTypeViewModel,
);
final AdvancedPrivacySettingsViewModel privacySettingsViewModel;
final NodeCreateOrEditViewModel nodeViewModel;
+11 -11
View File
@@ -44,7 +44,7 @@ class NewWalletPage extends BasePage {
@override
Widget Function(BuildContext, Widget) get rootWrapper =>
(BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold);
(BuildContext context, Widget scaffold) => GradientBackground(scaffold: scaffold);
@override
String get title => S.current.new_wallet;
@@ -228,11 +228,11 @@ class _WalletNameFormState extends State<WalletNameForm> {
color: Theme.of(context).colorScheme.onSurface,
),
placeholderTextStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
height: 1.4,
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
color: Theme.of(context).colorScheme.onSurfaceVariant,
height: 1.4,
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
hintText: S.of(context).password,
),
BaseTextFormField(
@@ -247,11 +247,11 @@ class _WalletNameFormState extends State<WalletNameForm> {
color: Theme.of(context).colorScheme.onSurface,
),
placeholderTextStyle: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurfaceVariant,
height: 1.4,
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
color: Theme.of(context).colorScheme.onSurfaceVariant,
height: 1.4,
fontSize: 18.0,
fontWeight: FontWeight.w500,
),
hintText: S.of(context).repeat_wallet_password,
),
],
@@ -143,8 +143,8 @@ class WalletTypeFormState extends State<WalletTypeForm> {
key: ValueKey('new_wallet_type_${type.name}_button_key'),
image: Image.asset(
walletTypeToCryptoCurrency(type).iconPath ?? '',
height: 24,
width: 24,
height: 28,
width: 28,
),
text: walletTypeToDisplayName(type),
showTrailingIcon: false,
@@ -51,101 +51,98 @@ class GroupedWalletExpansionTile extends StatelessWidget {
@override
Widget build(BuildContext context) {
final backgroundColor = color ?? (isSelected ? Theme.of(context).colorScheme.primary : Theme.of(context).colorScheme.surfaceContainer);
final backgroundColor = color ??
(isSelected
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.surfaceContainer);
final effectiveTextColor = textColor ??
(isSelected
? Theme.of(context).colorScheme.onPrimary
: Theme.of(context).colorScheme.onSecondaryContainer);
: Theme.of(context).colorScheme.onSurface);
final effectiveArrowColor = arrowColor ??
(isSelected
? Theme.of(context).colorScheme.onPrimary
: Theme.of(context).colorScheme.onSecondaryContainer);
return Container(
decoration: BoxDecoration(
borderRadius: borderRadius ?? BorderRadius.all(Radius.circular(30)),
color: backgroundColor,
),
margin: margin ?? const EdgeInsets.only(bottom: 12.0),
child: Theme(
data: Theme.of(context).copyWith(
dividerColor: Colors.transparent,
splashFactory: NoSplash.splashFactory,
),
child: ExpansionTile(
onExpansionChanged: onExpansionChanged,
initiallyExpanded: shouldShowCurrentWalletPointer
? childWallets.any((element) => element.isCurrent)
: false,
key: tileKey,
tilePadding:
EdgeInsets.symmetric(vertical: 1, horizontal: !isCurrentlySelectedWallet ? 16 : 0),
iconColor: effectiveArrowColor,
collapsedIconColor: effectiveArrowColor,
leading: leadingWidget,
trailing: trailingWidget ?? (childWallets.isEmpty ? SizedBox.shrink() : null),
title: GestureDetector(
onTap: onTitleTapped,
child: Text(
title,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 18,
fontWeight: FontWeight.w500,
color: effectiveTextColor,
),
textAlign: TextAlign.left,
),
: Theme.of(context).colorScheme.onSurfaceVariant);
return Padding(
padding: EdgeInsets.symmetric(vertical: 6),
child: ExpansionTile(
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
collapsedShape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(16)),
collapsedBackgroundColor: backgroundColor,
backgroundColor: backgroundColor,
onExpansionChanged: onExpansionChanged,
initiallyExpanded: shouldShowCurrentWalletPointer
? childWallets.any((element) => element.isCurrent)
: false,
key: tileKey,
tilePadding:
EdgeInsets.symmetric(vertical: 1, horizontal: !isCurrentlySelectedWallet ? 16 : 0),
iconColor: effectiveArrowColor,
collapsedIconColor: effectiveArrowColor,
leading: leadingWidget,
trailing: trailingWidget ?? (childWallets.isEmpty ? SizedBox.shrink() : null),
title: GestureDetector(
onTap: onTitleTapped,
child: Text(
title,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 18,
fontWeight: FontWeight.w500,
color: effectiveTextColor,
),
textAlign: TextAlign.left,
),
children: childWallets.map(
(item) {
final currentColor = item.isCurrent
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.surface;
final walletTypeToCrypto = walletTypeToCryptoCurrency(item.type);
return ListTile(
contentPadding: EdgeInsets.zero,
key: ValueKey(item.name),
trailing: childTrailingWidget?.call(item),
onTap: () => onChildItemTapped(item),
leading: SizedBox(
width: 60,
child: Row(
children: [
item.isCurrent && shouldShowCurrentWalletPointer
? Container(
height: 35,
width: 6,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(16),
bottomRight: Radius.circular(16),
),
color: currentColor,
),
)
: SizedBox(width: 6),
SizedBox(width: 16),
Image.asset(
walletTypeToCrypto.iconPath!,
width: 32,
height: 32,
),
],
),
),
title: Text(
item.name,
maxLines: 2,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 18,
fontWeight: FontWeight.w500,
color: effectiveTextColor,
),
),
);
},
).toList(),
),
children: childWallets.map(
(item) {
final currentColor = item.isCurrent
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.surface;
final walletTypeToCrypto = walletTypeToCryptoCurrency(item.type);
return ListTile(
contentPadding: EdgeInsets.zero,
key: ValueKey(item.name),
trailing: childTrailingWidget?.call(item),
onTap: () => onChildItemTapped(item),
leading: SizedBox(
width: 64,
child: Row(
children: [
item.isCurrent && shouldShowCurrentWalletPointer
? Container(
height: 35,
width: 6,
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(16),
bottomRight: Radius.circular(16),
),
color: currentColor,
),
)
: SizedBox(width: 7),
SizedBox(width: 24),
Image.asset(
walletTypeToCrypto.iconPath!,
width: 32,
height: 32,
),
],
),
),
title: Text(
item.name,
maxLines: 2,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 18,
fontWeight: FontWeight.w500,
color: effectiveTextColor,
),
),
);
},
).toList(),
),
);
}
@@ -1,8 +1,8 @@
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
import 'package:cake_wallet/themes/core/custom_theme_colors.dart';
import 'package:flutter/material.dart';
class NodeIndicator extends StatelessWidget {
NodeIndicator({this.isLive = false});
const NodeIndicator({this.isLive = false});
final bool isLive;
@@ -20,7 +20,6 @@ class AddressListPage extends BasePage {
children: <Widget>[
AddressList(
addressListViewModel: addressListViewModel,
currentTheme: currentTheme,
onSelect: (String address) async {
Navigator.of(context).pop(address);
},
+1 -2
View File
@@ -102,10 +102,9 @@ class ReceivePage extends BasePage {
heroTag: _heroTag,
amountTextFieldFocusNode: _cryptoAmountFocus,
amountController: _amountController,
currentTheme: currentTheme,
),
),
AddressList(addressListViewModel: addressListViewModel, currentTheme: currentTheme),
AddressList(addressListViewModel: addressListViewModel),
Padding(
padding: EdgeInsets.fromLTRB(24, 24, 24, 32),
child: Text(
@@ -1,5 +1,4 @@
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/utils/address_formatter.dart';
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_item.dart';
import 'package:cw_core/wallet_type.dart';
@@ -16,7 +15,6 @@ class AddressCell extends StatelessWidget {
required this.backgroundColor,
required this.textColor,
required this.walletType,
required this.currentTheme,
this.onTap,
this.onEdit,
this.onHide,
@@ -35,7 +33,6 @@ class AddressCell extends StatelessWidget {
required Color backgroundColor,
required Color textColor,
required WalletType walletType,
required MaterialThemeBase currentTheme,
Function(String)? onTap,
bool hasBalance = false,
bool hasReceived = false,
@@ -52,7 +49,6 @@ class AddressCell extends StatelessWidget {
backgroundColor: backgroundColor,
textColor: textColor,
walletType: walletType,
currentTheme: currentTheme,
onTap: onTap,
onEdit: onEdit,
onHide: onHide,
@@ -72,7 +68,6 @@ class AddressCell extends StatelessWidget {
final Color backgroundColor;
final Color textColor;
final WalletType walletType;
final MaterialThemeBase currentTheme;
final Function(String)? onTap;
final Function()? onEdit;
final Function()? onHide;
@@ -19,15 +19,9 @@ import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
class AddressList extends StatefulWidget {
const AddressList({
super.key,
required this.addressListViewModel,
required this.currentTheme,
this.onSelect,
});
const AddressList({super.key, required this.addressListViewModel, this.onSelect});
final WalletAddressListViewModel addressListViewModel;
final MaterialThemeBase currentTheme;
final Function(String)? onSelect;
@override
@@ -167,7 +161,6 @@ class _AddressListState extends State<AddressList> {
return AddressCell.fromItem(
item,
isCurrent: isCurrent,
currentTheme: widget.currentTheme,
walletType: widget.addressListViewModel.type,
hasBalance: widget.addressListViewModel.isBalanceAvailable,
hasReceived: widget.addressListViewModel.isReceivedAvailable,
@@ -1,6 +1,5 @@
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cw_core/crypto_amount_format.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@@ -15,7 +14,6 @@ class CurrencyAmountTextField extends StatelessWidget {
this.allAmountButton = false,
this.isPickerEnable = false,
this.isSelected = false,
this.currentThemeType = ThemeType.dark,
this.onTapPicker,
this.padding,
this.imageArrow,
@@ -54,7 +52,6 @@ class CurrencyAmountTextField extends StatelessWidget {
final bool isAmountEditable;
final FormFieldValidator<String>? currencyValueValidator;
final bool isPickerEnable;
final ThemeType currentThemeType;
final bool isSelected;
final bool allAmountButton;
final VoidCallback? allAmountCallback;
@@ -84,7 +81,7 @@ class CurrencyAmountTextField extends StatelessWidget {
child: imageArrow ??
Image.asset(
'assets/images/arrow_bottom_purple_icon.png',
color: textColor,
color: Theme.of(context).colorScheme.primary,
height: 8,
),
),
@@ -4,7 +4,6 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/exchange/widgets/currency_picker.dart';
import 'package:cake_wallet/src/screens/receive/widgets/currency_input_field.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
import 'package:cake_wallet/src/widgets/bottom_sheet/base_bottom_sheet_widget.dart';
@@ -24,7 +23,6 @@ import 'package:url_launcher/url_launcher.dart';
class QRWidget extends StatelessWidget {
QRWidget({
required this.addressListViewModel,
required this.currentTheme,
this.qrVersion,
this.heroTag,
required this.amountController,
@@ -36,7 +34,6 @@ class QRWidget extends StatelessWidget {
final TextEditingController amountController;
final FocusNode? amountTextFieldFocusNode;
final GlobalKey<FormState> formKey;
final MaterialThemeBase currentTheme;
final int? qrVersion;
final String? heroTag;
@@ -211,7 +208,6 @@ class QRWidget extends StatelessWidget {
amountFocusNode: amountTextFieldFocusNode,
amountController: amountController,
padding: EdgeInsets.only(top: 20, left: _width / 4),
currentThemeType: currentTheme.type,
isAmountEditable: true,
tag: addressListViewModel.selectedCurrency.tag,
onTapPicker: () => _presentPicker(context),
@@ -312,7 +308,6 @@ class QRWidget extends StatelessWidget {
builder: (context) => InfoBottomSheet(
titleText: S.of(context).payjoin_unavailable_sheet_title,
content: S.of(context).payjoin_unavailable_sheet_content,
currentTheme: currentTheme,
footerType: FooterType.doubleActionButton,
doubleActionLeftButtonText: S.of(context).learn_more,
onLeftActionButtonPressed: () => launchUrl(
@@ -10,7 +10,6 @@ import 'package:cake_wallet/utils/permission_handler.dart';
import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/restore/wallet_restore_from_qr_code.dart';
import 'package:cake_wallet/wallet_type_utils.dart';
import 'package:cw_core/wallet_info.dart';
import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart';
@@ -20,12 +19,13 @@ class RestoreOptionsPage extends BasePage {
@override
String get title => S.current.restore_restore_wallet;
final bool isNewInstall;
@override
Widget body(BuildContext context) =>
_RestoreOptionsBody(isNewInstall: isNewInstall, themeType: currentTheme.type);
Widget body(BuildContext context) => _RestoreOptionsBody(
isNewInstall: isNewInstall,
themeType: currentTheme.type,
);
}
class _RestoreOptionsBody extends StatefulWidget {
@@ -71,70 +71,68 @@ class _RestoreOptionsBodyState extends State<_RestoreOptionsBody> {
return Center(
child: Container(
width: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint,
height: double.infinity,
padding: EdgeInsets.symmetric(vertical: 24, horizontal: 24),
child: SingleChildScrollView(
child: Column(
children: <Widget>[
OptionTile(
key: ValueKey('restore_options_from_seeds_or_keys_button_key'),
onPressed: () => Navigator.pushNamed(context, Routes.restoreWalletFromSeedKeys),
image: imageSeedKeys,
title: S.of(context).restore_title_from_seed_keys,
description: S.of(context).restore_description_from_seed_keys,
),
if (FeatureFlag.hasBitcoinViewOnly && DeviceInfo.instance.isMobile)
Padding(
padding: EdgeInsets.only(top: 24),
child: OptionTile(
key: ValueKey('restore_options_from_cupcake_button_key'),
onPressed: () => _onScanQRCode(context),
image: imageRestoreCupcake,
title: S.of(context).restore_title_from_cupcake,
description: S.of(context).restore_description_from_cupcake,
tag: S.of(context).new_tag,
),
),
width: ResponsiveLayoutUtilBase.kDesktopMaxWidthConstraint,
height: double.infinity,
padding: EdgeInsets.symmetric(vertical: 24, horizontal: 24),
child: SingleChildScrollView(
child: Column(
children: <Widget>[
OptionTile(
key: ValueKey('restore_options_from_seeds_or_keys_button_key'),
onPressed: () => Navigator.pushNamed(context, Routes.restoreWalletFromSeedKeys),
image: imageSeedKeys,
title: S.of(context).restore_title_from_seed_keys,
description: S.of(context).restore_description_from_seed_keys,
),
if (FeatureFlag.hasBitcoinViewOnly && DeviceInfo.instance.isMobile)
Padding(
padding: EdgeInsets.only(top: 24),
padding: EdgeInsets.only(top: 12),
child: OptionTile(
key: ValueKey('restore_options_from_hardware_wallet_button_key'),
onPressed: () => Navigator.pushNamed(
context,
isSingleCoin
? Routes.connectHardwareWallet
: Routes.restoreWalletFromHardwareWallet),
image: imageRestoreHW,
title: S.of(context).restore_title_from_hardware_wallet,
description: S.of(context).restore_description_from_hardware_wallet,
key: ValueKey('restore_options_from_cupcake_button_key'),
onPressed: () => _onScanQRCode(context),
image: imageRestoreCupcake,
title: S.of(context).restore_title_from_cupcake,
description: S.of(context).restore_description_from_cupcake,
tag: S.of(context).new_tag,
),
),
if (widget.isNewInstall)
Padding(
padding: EdgeInsets.only(top: 24),
child: OptionTile(
key: ValueKey('restore_options_from_backup_button_key'),
onPressed: () => Navigator.pushNamed(context, Routes.restoreFromBackup),
image: imageRestoreBackup,
title: S.of(context).restore_title_from_backup,
description: S.of(context).restore_description_from_backup,
),
Padding(
padding: EdgeInsets.only(top: 12),
child: OptionTile(
key: ValueKey('restore_options_from_hardware_wallet_button_key'),
onPressed: () =>
Navigator.pushNamed(context, Routes.restoreWalletFromHardwareWallet),
image: imageRestoreHW,
title: S.of(context).restore_title_from_hardware_wallet,
description: S.of(context).restore_description_from_hardware_wallet,
),
),
if (widget.isNewInstall)
Padding(
padding: EdgeInsets.only(top: 12),
child: OptionTile(
key: ValueKey('restore_options_from_backup_button_key'),
onPressed: () => Navigator.pushNamed(context, Routes.restoreFromBackup),
image: imageRestoreBackup,
title: S.of(context).restore_title_from_backup,
description: S.of(context).restore_description_from_backup,
),
if (DeviceInfo.instance.isMobile)
Padding(
padding: EdgeInsets.only(top: 24),
child: OptionTile(
key: ValueKey('restore_options_from_qr_button_key'),
onPressed: () => _onScanQRCode(context),
image: imageRestoreQR,
title: S.of(context).scan_qr_code,
description: S.of(context).cold_or_recover_wallet,
),
),
if (DeviceInfo.instance.isMobile)
Padding(
padding: EdgeInsets.only(top: 12),
child: OptionTile(
key: ValueKey('restore_options_from_qr_button_key'),
onPressed: () => _onScanQRCode(context),
image: imageRestoreQR,
title: S.of(context).scan_qr_code,
description: S.of(context).cold_or_recover_wallet,
),
],
),
)),
),
],
),
),
),
);
}
@@ -42,7 +42,6 @@ class WalletRestorePage extends BasePage {
: S.current.restore_title_from_keys,
style: Theme.of(context).textTheme.titleMedium?.copyWith(
fontSize: 18,
fontWeight: FontWeight.w600,
),
),
@@ -147,7 +146,6 @@ class WalletRestorePage extends BasePage {
bottom: MediaQuery.of(bottomSheetContext).viewInsets.bottom,
),
child: AddPassphraseBottomSheet(
currentTheme: currentTheme,
titleText: S.of(context).add_passphrase,
onRestoreButtonPressed: (passphrase) async {
await _onPassphraseBottomSheetRestoreButtonPressed(
+20
View File
@@ -153,6 +153,10 @@ class RootState extends State<Root> with WidgetsBindingObserver {
break;
case AppLifecycleState.resumed:
// Reset inactive state when app resumes
if (_isInactive) setState(() => _setInactive(false));
widget.authService.requireAuth().then((value) {
if (mounted) {
setState(() {
@@ -201,8 +205,14 @@ class RootState extends State<Root> with WidgetsBindingObserver {
@override
void didChangePlatformBrightness() {
// Only handle theme changes when the app is active (not in background)
if (_isInactive) return;
if (widget.appStore.themeStore.themeMode == ThemeMode.system) {
Future.delayed(Duration(milliseconds: Platform.isIOS ? 500 : 0), () {
// Double-check that app is still active before applying theme change
if (_isInactive) return;
final systemTheme = widget.appStore.themeStore.getThemeFromSystem();
if (widget.appStore.themeStore.currentTheme != systemTheme) {
widget.appStore.themeStore.setTheme(systemTheme);
@@ -272,6 +282,16 @@ class RootState extends State<Root> with WidgetsBindingObserver {
_postFrameCallback = false;
_setInactive(false);
});
// Apply any missed theme changes after successful authentication
if (widget.appStore.themeStore.themeMode == ThemeMode.system) {
Future.delayed(Duration(milliseconds: 100), () {
final systemTheme = widget.appStore.themeStore.getThemeFromSystem();
if (widget.appStore.themeStore.currentTheme != systemTheme) {
widget.appStore.themeStore.setTheme(systemTheme);
}
});
}
}
void _setInactive(bool value) {
+5 -8
View File
@@ -68,19 +68,16 @@ class WalletSeedPage extends BasePage {
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
SizedBox(height: 16),
WarningBox(
content: S.current.cake_seeds_save_disclaimer,
currentTheme: currentTheme,
),
WarningBox(content: S.current.cake_seeds_save_disclaimer),
SizedBox(height: 36),
Text(
key: ValueKey('wallet_seed_page_wallet_name_text_key'),
walletSeedViewModel.name,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 18,
fontWeight: FontWeight.w600,
color: Theme.of(context).colorScheme.onSurface,
),
fontSize: 18,
fontWeight: FontWeight.w600,
color: Theme.of(context).colorScheme.onSurface,
),
),
SizedBox(height: 24),
Expanded(
-4
View File
@@ -580,7 +580,6 @@ class SendPage extends BasePage {
key: ValueKey('send_page_confirm_sending_bottom_sheet_key'),
titleText: S.of(bottomSheetContext).confirm_transaction,
accessibleNavigationModeSlideActionButtonText: S.of(bottomSheetContext).send,
currentTheme: currentTheme,
footerType: FooterType.slideActionButton,
walletType: sendViewModel.walletType,
titleIconPath: sendViewModel.selectedCryptoCurrency.iconPath,
@@ -630,7 +629,6 @@ class SendPage extends BasePage {
builder: (BuildContext bottomSheetContext) {
return showContactSheet && sendViewModel.ocpRequest == null
? InfoBottomSheet(
currentTheme: currentTheme,
footerType: FooterType.doubleActionButton,
titleText: S.of(bottomSheetContext).transaction_sent,
contentImage: 'assets/images/contact.png',
@@ -684,7 +682,6 @@ class SendPage extends BasePage {
},
)
: InfoBottomSheet(
currentTheme: currentTheme,
footerType: FooterType.singleActionButton,
titleText: S.of(bottomSheetContext).transaction_sent,
contentImage: 'assets/images/birthday_cake.png',
@@ -747,7 +744,6 @@ class SendPage extends BasePage {
builder: (context) {
dialogContext = context;
return InfoBottomSheet(
currentTheme: currentTheme,
footerType: FooterType.singleActionButton,
titleText: S.of(context).proceed_on_device,
contentImage: 'assets/images/hardware_wallet/ledger_nano_x.png',
+5 -4
View File
@@ -121,8 +121,11 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
WidgetsBinding.instance.addPostFrameCallback(
(timeStamp) {
if (mounted) {
final prefix = initialPaymentRequest!.scheme.isNotEmpty ? "${initialPaymentRequest!.scheme}:" : "";
final amount = initialPaymentRequest!.amount.isNotEmpty ? "?amount=${initialPaymentRequest!.amount}" : "";
final prefix =
initialPaymentRequest!.scheme.isNotEmpty ? "${initialPaymentRequest!.scheme}:" : "";
final amount = initialPaymentRequest!.amount.isNotEmpty
? "?amount=${initialPaymentRequest!.amount}"
: "";
final uri = prefix + initialPaymentRequest!.address + amount;
_handlePaymentFlow(uri, initialPaymentRequest!);
}
@@ -188,7 +191,6 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
paymentFlowResult: result,
paymentViewModel: paymentViewModel,
walletSwitcherViewModel: walletSwitcherViewModel,
currentTheme: currentTheme,
paymentRequest: paymentRequest,
onSelectWallet: () => _handleSelectWallet(
paymentViewModel,
@@ -221,7 +223,6 @@ class SendCardState extends State<SendCard> with AutomaticKeepAliveClientMixin<S
builder: (BuildContext dialogContext) {
return WalletSwitcherBottomSheet(
viewModel: walletSwitcherViewModel,
currentTheme: currentTheme,
filterWalletType: paymentViewModel.detectedWalletType,
);
},
@@ -14,11 +14,12 @@ import 'package:cake_wallet/src/widgets/base_text_form_field.dart';
import 'package:mobx/mobx.dart';
class SendTemplateCard extends StatelessWidget {
SendTemplateCard(
{super.key,
required this.template,
required this.index,
required this.sendTemplateViewModel});
SendTemplateCard({
super.key,
required this.template,
required this.index,
required this.sendTemplateViewModel,
});
final TemplateViewModel template;
final int index;
@@ -1,18 +1,15 @@
import 'dart:async';
import 'dart:io';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_picker_cell.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart';
import 'package:cake_wallet/src/widgets/alert_with_no_action.dart.dart';
import 'package:cake_wallet/src/widgets/alert_with_one_action.dart';
import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
import 'package:cake_wallet/view_model/settings/sync_mode.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:permission_handler/permission_handler.dart';
class BackgroundSyncPage extends BasePage {
BackgroundSyncPage(this.dashboardViewModel);
@@ -36,12 +33,14 @@ class BackgroundSyncPage extends BasePage {
onValueChange: (_, bool value) async {
if (value) {
if (dashboardViewModel.batteryOptimizationEnabled) {
await showPopUp(context: context, builder: (context) => AlertWithOneAction(
alertTitle: S.current.background_sync,
alertContent: S.current.unrestricted_background_service_notice,
buttonText: S.current.ok,
buttonAction: () => Navigator.of(context).pop(),
));
await showPopUp(
context: context,
builder: (context) => AlertWithOneAction(
alertTitle: S.current.background_sync,
alertContent: S.current.unrestricted_background_service_notice,
buttonText: S.current.ok,
buttonAction: () => Navigator.of(context).pop(),
));
await dashboardViewModel.disableBatteryOptimization();
for (var i = 0; i < 4 * 60; i++) {
await Future.delayed(Duration(milliseconds: 250));
@@ -65,16 +64,20 @@ class BackgroundSyncPage extends BasePage {
items: SyncMode.all,
displayItem: (SyncMode syncMode) => syncMode.name,
selectedItem: dashboardViewModel.settingsStore.currentSyncMode,
onItemSelected: (dashboardViewModel.batteryOptimizationEnabled && dashboardViewModel.hasBatteryOptimization) ? null : (syncMode) async {
dashboardViewModel.setSyncMode(syncMode);
});
onItemSelected: (dashboardViewModel.batteryOptimizationEnabled &&
dashboardViewModel.hasBatteryOptimization)
? null
: (syncMode) async {
dashboardViewModel.setSyncMode(syncMode);
});
}),
if (dashboardViewModel.hasBgsyncNetworkConstraints)
Observer(builder: (context) {
return SettingsSwitcherCell(
title: S.current.background_sync_on_unmetered_network,
value: dashboardViewModel.backgroundSyncNetworkUnmetered,
onValueChange: (_, bool value) => dashboardViewModel.setBackgroundSyncNetworkUnmetered(value),
onValueChange: (_, bool value) =>
dashboardViewModel.setBackgroundSyncNetworkUnmetered(value),
);
}),
if (dashboardViewModel.hasBgsyncBatteryNotLowConstraints)
@@ -82,7 +85,8 @@ class BackgroundSyncPage extends BasePage {
return SettingsSwitcherCell(
title: S.current.background_sync_on_battery_low,
value: !dashboardViewModel.backgroundSyncBatteryNotLow,
onValueChange: (_, bool value) => dashboardViewModel.setBackgroundSyncBatteryNotLow(!value),
onValueChange: (_, bool value) =>
dashboardViewModel.setBackgroundSyncBatteryNotLow(!value),
);
}),
if (dashboardViewModel.hasBgsyncChargingConstraints)
@@ -90,7 +94,8 @@ class BackgroundSyncPage extends BasePage {
return SettingsSwitcherCell(
title: S.current.background_sync_on_charging,
value: dashboardViewModel.backgroundSyncCharging,
onValueChange: (_, bool value) => dashboardViewModel.setBackgroundSyncCharging(value),
onValueChange: (_, bool value) =>
dashboardViewModel.setBackgroundSyncCharging(value),
);
}),
if (dashboardViewModel.hasBgsyncDeviceIdleConstraints)
@@ -98,25 +103,28 @@ class BackgroundSyncPage extends BasePage {
return SettingsSwitcherCell(
title: S.current.background_sync_on_device_idle,
value: dashboardViewModel.backgroundSyncDeviceIdle,
onValueChange: (_, bool value) => dashboardViewModel.setBackgroundSyncDeviceIdle(value),
onValueChange: (_, bool value) =>
dashboardViewModel.setBackgroundSyncDeviceIdle(value),
);
}),
Observer(builder: (context) {
return SettingsSwitcherCell(
title: S.current.new_transactions_notifications,
value: dashboardViewModel.backgroundSyncNotificationsEnabled,
onValueChange: (_, bool value) {
onValueChange: (_, bool value) {
try {
dashboardViewModel.setBackgroundSyncNotificationsEnabled(value);
} catch (e) {
showPopUp(context: context, builder: (context) => AlertWithOneAction(
alertTitle: S.current.error,
alertContent: S.current.notification_permission_denied,
buttonText: S.current.ok,
buttonAction: () {
Navigator.of(context).pop();
},
));
showPopUp(
context: context,
builder: (context) => AlertWithOneAction(
alertTitle: S.current.error,
alertContent: S.current.notification_permission_denied,
buttonText: S.current.ok,
buttonAction: () {
Navigator.of(context).pop();
},
));
}
},
);
@@ -3,6 +3,7 @@ import 'package:cake_wallet/entities/language_service.dart';
import 'package:cake_wallet/entities/sync_status_display_mode.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_choices_cell.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_picker_cell.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_theme_choice.dart';
@@ -12,6 +13,7 @@ import 'package:cake_wallet/utils/device_info.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';
import 'package:cake_wallet/view_model/settings/choices_list_item.dart';
import 'package:cake_wallet/view_model/settings/display_settings_view_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
@@ -32,6 +34,7 @@ class DisplaySettingsPage extends BasePage {
return Container(
padding: EdgeInsets.only(top: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
SettingsSwitcherCell(
title: S.of(context).show_market_place,
@@ -100,17 +103,59 @@ class DisplaySettingsPage extends BasePage {
),
if (responsiveLayoutUtil.shouldRenderMobileUI && DeviceInfo.instance.isMobile) ...[
SettingsSwitcherCell(
title: S.of(context).use_device_theme,
value: _displaySettingsViewModel.themeMode == ThemeMode.system,
onValueChange: (_, bool value) {
_displaySettingsViewModel
.setThemeMode(value ? ThemeMode.system : ThemeMode.dark);
},
SizedBox(height: 24),
Padding(
padding: const EdgeInsets.only(left: 24),
child: Text(
S.current.appearance,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
fontWeight: FontWeight.w400,
fontSize: 14,
height: 22 / 14,
color: Theme.of(context).colorScheme.onSurface,
),
),
),
Semantics(
label: S.of(context).color_theme,
child: SettingsThemeChoicesCell(_displaySettingsViewModel),
SizedBox(height: 12),
Container(
margin: EdgeInsets.symmetric(horizontal: 20),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainer,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
SettingsChoicesCell(
ChoicesListItem<ThemeMode>(
title: "",
items: ThemeMode.values,
selectedItem: _displaySettingsViewModel.themeMode,
onItemSelected: (ThemeMode themeMode) =>
_displaySettingsViewModel.setThemeMode(themeMode),
displayItem: (ThemeMode themeMode) {
return themeMode.name[0].toUpperCase() +
themeMode.name.substring(1).toLowerCase();
},
),
useGenericColor: false,
padding: EdgeInsets.all(12),
),
Container(
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainerHigh,
borderRadius: BorderRadius.circular(16),
),
child: Column(
children: [
Semantics(
label: S.of(context).color_theme,
child: SettingsThemeChoicesCell(_displaySettingsViewModel),
),
],
),
),
],
),
),
],
],
@@ -114,8 +114,8 @@ class SecurityBackupPage extends BasePage {
key: ValueKey('security_backup_page_sign_and_verify'),
title: S.current.sign_verify_title,
handler: (_) => Navigator.of(context).pushNamed(Routes.signPage)
//_securitySettingsViewModel.pinCodeRequiredDuration,
),
//_securitySettingsViewModel.pinCodeRequiredDuration,
),
Observer(
builder: (context) {
return SettingsCellWithArrow(
@@ -53,7 +53,11 @@ class TrocadorProvidersPage extends BasePage {
}
class Badge extends StatelessWidget {
Badge({required this.textColor, required this.backgroundColor, required this.title, required this.subTitle});
Badge(
{required this.textColor,
required this.backgroundColor,
required this.title,
required this.subTitle});
final String title;
final String subTitle;
@@ -79,10 +83,10 @@ class Badge extends StatelessWidget {
title,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: textColor,
fontSize: 7,
fontWeight: FontWeight.w600,
),
color: textColor,
fontSize: 7,
fontWeight: FontWeight.w600,
),
),
VerticalDivider(
color: textColor,
@@ -91,9 +95,9 @@ class Badge extends StatelessWidget {
Text(
subTitle,
style: Theme.of(context).textTheme.bodySmall!.copyWith(
color: textColor,
fontWeight: FontWeight.w600,
),
color: textColor,
fontWeight: FontWeight.w600,
),
),
],
),
@@ -4,20 +4,20 @@ import 'package:cake_wallet/src/widgets/picker.dart';
import 'package:cake_wallet/src/widgets/standard_list.dart';
class SettingsPriorityPickerCell<ItemType> extends StandardListRow {
SettingsPriorityPickerCell(
{required String title,
required this.selectedItem,
required this.items,
this.displayItem,
this.images,
this.searchHintText,
this.isGridView = false,
this.matchingCriteria,
this.customValue,
this.maxValue,
this.customItemIndex,
this.onItemSelected})
: super(
SettingsPriorityPickerCell({
required String title,
required this.selectedItem,
required this.items,
this.displayItem,
this.images,
this.searchHintText,
this.isGridView = false,
this.matchingCriteria,
this.customValue,
this.maxValue,
this.customItemIndex,
this.onItemSelected,
}) : super(
title: title,
isSelected: false,
onTap: (BuildContext context) async {
@@ -2,15 +2,19 @@ import 'package:cake_wallet/view_model/settings/choices_list_item.dart';
import 'package:flutter/material.dart';
class SettingsChoicesCell extends StatelessWidget {
const SettingsChoicesCell(this.choicesListItem, {Key? key}) : super(key: key);
const SettingsChoicesCell(this.choicesListItem,
{this.useGenericColor = true, this.padding, Key? key})
: super(key: key);
final ChoicesListItem<dynamic> choicesListItem;
final bool useGenericColor;
final EdgeInsets? padding;
@override
Widget build(BuildContext context) {
return Container(
color: Theme.of(context).colorScheme.surface,
padding: EdgeInsets.only(left: 24, right: 24, top: 16, bottom: 16),
color: useGenericColor ? Theme.of(context).colorScheme.surface : null,
padding: padding ?? EdgeInsets.only(left: 24, right: 24, top: 16, bottom: 16),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
@@ -30,7 +34,14 @@ class SettingsChoicesCell extends StatelessWidget {
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10),
color: Theme.of(context).colorScheme.surfaceContainerHighest,
border: useGenericColor
? null
: Border.all(
color: Theme.of(context).colorScheme.surfaceContainerHighest,
width: 1.5,
),
color:
useGenericColor ? Theme.of(context).colorScheme.surfaceContainerHighest : null,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
@@ -11,16 +11,21 @@ class SettingsSwitcherCell extends StandardListRow {
this.leading,
void Function(BuildContext context)? onTap,
Key? key,
this.padding,
this.switchBackgroundColor,
}) : super(title: title, isSelected: false, decoration: decoration, onTap: onTap, key: key);
final bool value;
final Color? switchBackgroundColor;
final void Function(BuildContext context, bool value)? onValueChange;
final Widget? leading;
final EdgeInsets? padding;
@override
Widget buildTrailing(BuildContext context) => StandardSwitch(
value: value,
onTapped: () => onValueChange?.call(context, !value),
backgroundColor: switchBackgroundColor,
);
@override
@@ -29,7 +34,7 @@ class SettingsSwitcherCell extends StandardListRow {
final trailing = buildTrailing(context);
return Container(
height: 56,
padding: EdgeInsets.only(left: 12, right: 12),
padding: padding ?? EdgeInsets.only(left: 12, right: 12),
child: TextButton(
onPressed: () {
if (onTap != null) {
@@ -39,6 +44,7 @@ class SettingsSwitcherCell extends StandardListRow {
}
},
style: ButtonStyle(
padding: WidgetStateProperty.all(padding ?? null),
//backgroundColor: MaterialStateProperty.all(Theme.of(context).colorScheme.surfaceContainer),
shape: WidgetStateProperty.all(
RoundedRectangleBorder(
@@ -1,112 +1,154 @@
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/settings/widgets/settings_switcher_cell.dart';
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/themes/utils/theme_list.dart';
import 'package:cake_wallet/themes/theme_classes/black_theme.dart';
import 'package:cake_wallet/view_model/settings/display_settings_view_model.dart';
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
class SettingsThemeChoicesCell extends StatelessWidget {
SettingsThemeChoicesCell(this._displaySettingsViewModel);
final items = ThemeList.all;
final DisplaySettingsViewModel _displaySettingsViewModel;
final double cellHeight = 25;
final double cellWidth = 12;
final double cellRadius = 6;
final double cellRadius = 8;
@override
Widget build(BuildContext context) {
return Container(
padding: EdgeInsets.all(cellHeight),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Row(
children: [
Text(
S.current.color_theme,
style: Theme.of(context).textTheme.bodyMedium,
),
],
),
SizedBox(height: cellHeight),
GridView.builder(
itemCount: items.length,
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
mainAxisExtent: 75,
crossAxisSpacing: 20,
),
itemBuilder: (context, index) {
final MaterialThemeBase e = items[index];
final currentTheme = _displaySettingsViewModel.theme;
final isSelected = currentTheme == e;
return Observer(
builder: (context) {
final availableThemes = _displaySettingsViewModel.availableThemes;
final currentTheme = _displaySettingsViewModel.currentTheme;
final availableAccentColors = _displaySettingsViewModel.availableAccentColors;
final screenHeight = MediaQuery.of(context).size.height;
return Padding(
padding: EdgeInsets.all(5),
child: Semantics(
label: e.toString(),
selected: isSelected,
child: GestureDetector(
onTap: () {
_displaySettingsViewModel.onThemeSelected(e);
},
child: Container(
padding: EdgeInsets.all(5),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(cellRadius),
border: isSelected
? Border.all(color: Theme.of(context).colorScheme.primary)
: null,
color: Theme.of(context)
.colorScheme
.onSurfaceVariant
.withOpacity(currentTheme.brightness == Brightness.light ? 0.1 : 0.3),
final previewHeight = _getResponsivePreviewHeight(screenHeight);
final previewWidth = previewHeight * 0.6;
return Container(
height: getHeight(context, currentTheme, currentTheme.hasAccentColors),
padding: EdgeInsets.all(12),
child: Column(
mainAxisSize: MainAxisSize.min,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Expanded(
child: ListView.builder(
itemCount: availableThemes.length,
scrollDirection: Axis.horizontal,
itemBuilder: (context, index) {
final MaterialThemeBase theme = availableThemes[index];
final isSelected = _displaySettingsViewModel.isThemeSelected(theme);
return Semantics(
label: theme.toString(),
selected: isSelected,
child: GestureDetector(
onTap: () {
_displaySettingsViewModel.onThemeSelected(theme);
},
child: Container(
margin: EdgeInsets.only(right: 24),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(cellRadius),
border: isSelected
? Border.all(
color: Theme.of(context).colorScheme.primary,
strokeAlign: BorderSide.strokeAlignOutside)
: null,
),
child: ClipRRect(
borderRadius: BorderRadius.circular(cellRadius),
child: CakeImageWidget(
imageUrl: _displaySettingsViewModel.getImageForTheme(theme),
fit: BoxFit.cover,
height: previewHeight,
width: previewWidth,
),
),
),
),
);
},
),
),
if (_displaySettingsViewModel.currentTheme.hasAccentColors) ...[
SizedBox(height: cellHeight),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Text(
S.of(context).accent_color,
style: Theme.of(context).textTheme.bodyMedium,
),
Container(
height: 40,
child: Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Container(
padding:
EdgeInsets.symmetric(horizontal: cellWidth, vertical: cellHeight),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(cellRadius),
bottomLeft: Radius.circular(cellRadius),
children: availableAccentColors.map((accentColor) {
final isSelected = _displaySettingsViewModel
.isAccentColorSelected(accentColor.name.toLowerCase());
return GestureDetector(
onTap: () {
_displaySettingsViewModel
.onAccentColorSelected(accentColor.name.toLowerCase());
},
child: Container(
width: 26,
height: 26,
margin: EdgeInsets.only(right: 11),
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(16),
border: isSelected
? Border.all(
color: Theme.of(context).colorScheme.onSurfaceVariant,
width: 3)
: null,
color: accentColor.color,
),
color: e.colorScheme.primary,
),
),
Container(
padding:
EdgeInsets.symmetric(horizontal: cellWidth, vertical: cellHeight),
decoration: BoxDecoration(color: e.colorScheme.surface),
),
Container(
padding:
EdgeInsets.symmetric(horizontal: cellWidth, vertical: cellHeight),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(cellRadius),
bottomRight: Radius.circular(cellRadius),
),
color: e.colorScheme.tertiary,
),
),
],
);
}).toList(),
),
),
),
],
),
);
},
],
if (_displaySettingsViewModel.currentTheme is BlackTheme)
SettingsSwitcherCell(
title: S.current.oled_mode,
value: _displaySettingsViewModel.isBlackThemeOledEnabled,
onValueChange: (_, bool value) {
_displaySettingsViewModel.setBlackThemeOled(value);
},
padding: EdgeInsets.zero,
switchBackgroundColor: currentTheme.colorScheme.secondaryContainer,
),
],
),
],
),
);
},
);
}
double getHeight(BuildContext context, MaterialThemeBase theme, bool hasAccentColors) {
final screenHeight = MediaQuery.of(context).size.height;
double baseHeight = (screenHeight * 0.25).clamp(150.0, screenHeight * 0.5);
if (hasAccentColors) {
baseHeight += (screenHeight * 0.05).clamp(35.0, 60.0);
}
if (theme is BlackTheme) {
baseHeight += (screenHeight * 0.08).clamp(48.0, 96.0);
}
return baseHeight;
}
double _getResponsivePreviewHeight(double screenHeight) =>
(screenHeight * 0.22).clamp(160.0, 240.0);
}
@@ -12,10 +12,6 @@ class SupportPage extends BasePage {
final SupportViewModel supportViewModel;
final imageLiveSupport = Image.asset('assets/images/cake_icon.png');
final imageWalletGuides = Image.asset('assets/images/wallet_guides.png');
final imageMoreLinks = Image.asset('assets/images/more_links.png');
@override
String get title => S.current.settings_support;
@@ -121,7 +121,6 @@ class RBFDetailsPage extends BasePage {
}
reaction((_) => transactionDetailsViewModel.sendViewModel.state, (ExecutionState state) {
if (state is! IsExecutingState &&
loadingBottomSheetContext != null &&
loadingBottomSheetContext!.mounted) {
@@ -191,16 +190,20 @@ class RBFDetailsPage extends BasePage {
return ConfirmSendingBottomSheet(
key: ValueKey('rbf_confirm_sending_bottom_sheet'),
titleText: S.of(bottomSheetContext).confirm_transaction,
currentTheme: currentTheme,
walletType: transactionDetailsViewModel.sendViewModel.walletType,
titleIconPath: transactionDetailsViewModel.sendViewModel.selectedCryptoCurrency.iconPath,
titleIconPath:
transactionDetailsViewModel.sendViewModel.selectedCryptoCurrency.iconPath,
currency: transactionDetailsViewModel.sendViewModel.selectedCryptoCurrency,
amount: S.of(bottomSheetContext).send_amount,
amountValue: transactionDetailsViewModel.sendViewModel.pendingTransaction!.amountFormatted,
fiatAmountValue: transactionDetailsViewModel.sendViewModel.pendingTransactionFiatAmountFormatted,
amountValue:
transactionDetailsViewModel.sendViewModel.pendingTransaction!.amountFormatted,
fiatAmountValue: transactionDetailsViewModel
.sendViewModel.pendingTransactionFiatAmountFormatted,
fee: S.of(bottomSheetContext).send_fee,
feeValue: transactionDetailsViewModel.sendViewModel.pendingTransaction!.feeFormatted,
feeFiatAmount: transactionDetailsViewModel.sendViewModel.pendingTransactionFeeFiatAmountFormatted,
feeValue:
transactionDetailsViewModel.sendViewModel.pendingTransaction!.feeFormatted,
feeFiatAmount: transactionDetailsViewModel
.sendViewModel.pendingTransactionFeeFiatAmountFormatted,
outputs: transactionDetailsViewModel.sendViewModel.outputs,
footerType: FooterType.slideActionButton,
accessibleNavigationModeSlideActionButtonText: S.of(context).send,
@@ -50,10 +50,12 @@ class UnspentCoinsDetailsPage extends BasePage {
if (item is UnspentCoinsSwitchItem) {
return Observer(
builder: (_) => UnspentCoinsSwitchRow(
title: item.title,
switchValue: item.switchValue(),
onSwitchValueChange: item.onSwitchValueChange));
builder: (_) => UnspentCoinsSwitchRow(
title: item.title,
switchValue: item.switchValue(),
onSwitchValueChange: item.onSwitchValueChange,
),
);
}
if (item is BlockExplorerListItem) {
@@ -5,7 +5,7 @@ import 'package:cake_wallet/src/screens/wallet_connect/models/wc_connection_mode
import 'package:cake_wallet/src/screens/wallet_connect/services/walletkit_service.dart';
import 'package:cake_wallet/src/screens/wallet_connect/widgets/wc_connection_widget.dart';
import 'package:cake_wallet/src/screens/wallet_connect/widgets/wc_request_widget.dart';
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
import 'package:cake_wallet/themes/core/custom_theme_colors.dart';
import 'package:flutter/material.dart';
import 'package:reown_walletkit/reown_walletkit.dart';
@@ -1,9 +1,7 @@
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/wallet_connect/services/bottom_sheet_service.dart';
import 'package:cake_wallet/src/screens/wallet_connect/widgets/wc_verify_context_widget.dart';
import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/themes/core/theme_store.dart';
import 'package:flutter/material.dart';
import 'package:reown_walletkit/reown_walletkit.dart';
@@ -22,13 +20,10 @@ class WCRequestWidget extends StatelessWidget {
@override
Widget build(BuildContext context) {
final currentTheme = getIt.get<ThemeStore>().currentTheme;
return Column(
mainAxisSize: MainAxisSize.min,
children: [
WCVerifyContextWidget(
currentTheme: currentTheme,
verifyContext: verifyContext,
),
const SizedBox(height: 8),
@@ -1,6 +1,5 @@
import 'package:cake_wallet/generated/i18n.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/custom_theme_colors.dart';
import 'package:flutter/material.dart';
import 'package:reown_walletkit/reown_walletkit.dart';
@@ -8,11 +7,9 @@ class WCVerifyContextWidget extends StatelessWidget {
const WCVerifyContextWidget({
super.key,
required this.verifyContext,
required this.currentTheme,
});
final VerifyContext? verifyContext;
final MaterialThemeBase currentTheme;
@override
Widget build(BuildContext context) {
@@ -7,7 +7,6 @@ import 'package:cake_wallet/src/widgets/primary_button.dart';
import 'package:cake_wallet/src/widgets/seedphrase_grid_widget.dart';
import 'package:cake_wallet/src/widgets/text_info_box.dart';
import 'package:cake_wallet/src/widgets/warning_box_widget.dart';
import 'package:cake_wallet/themes/core/material_base_theme.dart';
import 'package:cake_wallet/utils/brightness_util.dart';
import 'package:cake_wallet/utils/clipboard_util.dart';
import 'package:cake_wallet/utils/show_bar.dart';
@@ -36,13 +35,11 @@ class WalletKeysPage extends BasePage {
child: WarningBox(
key: const ValueKey('wallet_keys_page_share_warning_text_key'),
content: S.of(context).do_not_share_warning_text.toUpperCase(),
currentTheme: currentTheme,
),
),
Expanded(
child: WalletKeysPageBody(
walletKeysViewModel: walletKeysViewModel,
currentTheme: currentTheme,
),
),
],
@@ -54,11 +51,9 @@ class WalletKeysPage extends BasePage {
class WalletKeysPageBody extends StatefulWidget {
WalletKeysPageBody({
required this.walletKeysViewModel,
required this.currentTheme,
});
final WalletKeysViewModel walletKeysViewModel;
final MaterialThemeBase currentTheme;
@override
State<StatefulWidget> createState() => _WalletKeysPageBodyState();
@@ -161,7 +156,11 @@ class _WalletKeysPageBodyState extends State<WalletKeysPageBody>
if (showKeyTab)
Padding(
padding: const EdgeInsets.only(left: 22, right: 22),
child: _buildKeysTab(context, showSilentPaymentsTab ? widget.walletKeysViewModel.items.sublist(0, 4) : widget.walletKeysViewModel.items),
child: _buildKeysTab(
context,
showSilentPaymentsTab
? widget.walletKeysViewModel.items.sublist(0, 4)
: widget.walletKeysViewModel.items),
),
if (showSilentPaymentsTab)
Padding(
@@ -20,27 +20,17 @@ class EditWalletButtonWidget extends StatelessWidget {
width: width,
child: Row(
children: [
GestureDetector(
onTap: onTap,
child: Center(
child: Container(
height: 40,
width: 44,
padding: EdgeInsets.all(10),
decoration: BoxDecoration(
shape: BoxShape.circle,
color: Theme.of(context).colorScheme.surface,
),
child: Icon(
Icons.edit,
size: 14,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
TextButton(
onPressed: onTap,
style: TextButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.surface, shape: CircleBorder()),
child: Icon(
Icons.edit,
size: 14,
color: Theme.of(context).colorScheme.onSurfaceVariant,
),
),
if (isGroup) ...{
SizedBox(width: 6),
Icon(
isExpanded ? Icons.keyboard_arrow_up : Icons.keyboard_arrow_down,
size: 24,
@@ -29,6 +29,23 @@ class FilteredListState extends State<FilteredList> {
if (widget.canReorder) {
return Observer(
builder: (_) => ReorderableListView.builder(
proxyDecorator: (child, index, animation) => Material(
child: Container(
//margin: EdgeInsets.symmetric(vertical: 5),
decoration: BoxDecoration(
color: Theme.of(context).colorScheme.surfaceContainer,
borderRadius: BorderRadius.circular(20.0),
boxShadow: [
BoxShadow(
color: Colors.black.withOpacity(0.3),
blurRadius: 5,
offset: const Offset(0, 6),
spreadRadius: 1)
],
),
child: child,
),
),
shrinkWrap: widget.shrinkWrap,
physics: widget.physics ?? const BouncingScrollPhysics(),
itemBuilder: widget.itemBuilder,
+128 -141
View File
@@ -116,21 +116,6 @@ class WalletListBody extends StatefulWidget {
}
class WalletListBodyState extends State<WalletListBody> {
final moneroIcon = Image.asset('assets/images/monero_logo.png', height: 24, width: 24);
final bitcoinIcon = Image.asset('assets/images/bitcoin.png', height: 24, width: 24);
final tBitcoinIcon = Image.asset('assets/images/tbtc.png', height: 24, width: 24);
final litecoinIcon = Image.asset('assets/images/litecoin_icon.png', height: 24, width: 24);
final decredIcon = Image.asset('assets/images/decred_icon.png', height: 24, width: 24);
final nonWalletTypeIcon = Image.asset('assets/images/close.png', height: 24, width: 24);
final havenIcon = Image.asset('assets/images/haven_logo.png', height: 24, width: 24);
final ethereumIcon = Image.asset('assets/images/eth_icon.png', height: 24, width: 24);
final bitcoinCashIcon = Image.asset('assets/images/bch_icon.png', height: 24, width: 24);
final nanoIcon = Image.asset('assets/images/nano_icon.png', height: 24, width: 24);
final polygonIcon = Image.asset('assets/images/matic_icon.png', height: 24, width: 24);
final solanaIcon = Image.asset('assets/images/sol_icon.png', height: 24, width: 24);
final tronIcon = Image.asset('assets/images/trx_icon.png', height: 24, width: 24);
final wowneroIcon = Image.asset('assets/images/wownero_icon.png', height: 24, width: 24);
final zanoIcon = Image.asset('assets/images/zano_icon.png', height: 24, width: 24);
final scrollController = ScrollController();
final double tileHeight = 60;
Flushbar<void>? _progressBar;
@@ -164,69 +149,68 @@ class WalletListBodyState extends State<WalletListBody> {
),
SizedBox(height: 16),
Container(
child: Observer(
builder: (_) => FilteredList(
shrinkWrap: true,
list: widget.walletListViewModel.multiWalletGroups,
updateFunction: widget.walletListViewModel.reorderAccordingToWalletList,
itemBuilder: (context, index) {
final group = widget.walletListViewModel.multiWalletGroups[index];
final groupName =
group.groupName ?? '${S.current.wallet_group} ${index + 1}';
child: Padding(
padding: EdgeInsets.only(left: 20, right: 20),
child: Observer(
builder: (_) => FilteredList(
shrinkWrap: true,
list: widget.walletListViewModel.multiWalletGroups,
updateFunction: widget.walletListViewModel.reorderAccordingToWalletList,
itemBuilder: (context, index) {
final group = widget.walletListViewModel.multiWalletGroups[index];
final groupName =
group.groupName ?? '${S.current.wallet_group} ${index + 1}';
widget.walletListViewModel.updateTileState(
index,
widget.walletListViewModel.expansionTileStateTrack[index] ?? false,
);
widget.walletListViewModel.updateTileState(
index,
widget.walletListViewModel.expansionTileStateTrack[index] ?? false,
);
return GroupedWalletExpansionTile(
onExpansionChanged: (value) {
widget.walletListViewModel.updateTileState(index, value);
setState(() {});
},
shouldShowCurrentWalletPointer: true,
borderRadius: BorderRadius.all(Radius.circular(16)),
margin: EdgeInsets.only(left: 20, right: 20, bottom: 12),
title: groupName,
tileKey: ValueKey('group_wallets_expansion_tile_widget_$index'),
leadingWidget: Icon(
Icons.account_balance_wallet_outlined,
size: 28,
),
trailingWidget: EditWalletButtonWidget(
width: 74,
isGroup: true,
isExpanded:
widget.walletListViewModel.expansionTileStateTrack[index]!,
onTap: () {
final wallet = widget.walletListViewModel
.convertWalletInfoToWalletListItem(group.wallets.first);
Navigator.of(context).pushNamed(
Routes.walletEdit,
arguments: WalletEditPageArguments(
walletListViewModel: widget.walletListViewModel,
editingWallet: wallet,
isWalletGroup: true,
groupName: groupName,
walletGroupKey: group.groupKey,
),
);
return GroupedWalletExpansionTile(
onExpansionChanged: (value) {
widget.walletListViewModel.updateTileState(index, value);
setState(() {});
},
),
childWallets: group.wallets.map((walletInfo) {
return widget.walletListViewModel
.convertWalletInfoToWalletListItem(walletInfo);
}).toList(),
isSelected: false,
onChildItemTapped: (wallet) =>
wallet.isCurrent ? null : _loadWallet(wallet),
childTrailingWidget: (item) {
return item.isCurrent
? SizedBox.shrink()
: Padding(
padding: const EdgeInsets.only(right: 16),
child: EditWalletButtonWidget(
width: 44,
shouldShowCurrentWalletPointer: true,
borderRadius: BorderRadius.all(Radius.circular(16)),
title: groupName,
tileKey: ValueKey('group_wallets_expansion_tile_widget_$index'),
leadingWidget: Icon(
Icons.account_balance_wallet_outlined,
size: 28,
),
trailingWidget: EditWalletButtonWidget(
width: 88,
isGroup: true,
isExpanded:
widget.walletListViewModel.expansionTileStateTrack[index]!,
onTap: () {
final wallet = widget.walletListViewModel
.convertWalletInfoToWalletListItem(group.wallets.first);
Navigator.of(context).pushNamed(
Routes.walletEdit,
arguments: WalletEditPageArguments(
walletListViewModel: widget.walletListViewModel,
editingWallet: wallet,
isWalletGroup: true,
groupName: groupName,
walletGroupKey: group.groupKey,
),
);
},
),
childWallets: group.wallets.map((walletInfo) {
return widget.walletListViewModel
.convertWalletInfoToWalletListItem(walletInfo);
}).toList(),
isSelected: false,
onChildItemTapped: (wallet) =>
wallet.isCurrent ? null : _loadWallet(wallet),
childTrailingWidget: (item) {
return item.isCurrent
? SizedBox.shrink()
: EditWalletButtonWidget(
width: 60,
onTap: () => Navigator.of(context).pushNamed(
Routes.walletEdit,
arguments: WalletEditPageArguments(
@@ -234,11 +218,11 @@ class WalletListBodyState extends State<WalletListBody> {
editingWallet: item,
),
),
),
);
},
);
},
);
},
);
},
),
),
),
),
@@ -257,68 +241,70 @@ class WalletListBodyState extends State<WalletListBody> {
),
),
SizedBox(height: 16),
Container(
child: Observer(
builder: (_) => FilteredList(
shrinkWrap: true,
list: widget.walletListViewModel.singleWalletsList,
updateFunction: widget.walletListViewModel.reorderAccordingToWalletList,
itemBuilder: (context, index) {
final wallet = widget.walletListViewModel.singleWalletsList[index];
final currentColor = wallet.isCurrent
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.surface;
return GroupedWalletExpansionTile(
tileKey: ValueKey('single_wallets_expansion_tile_widget_$index'),
isCurrentlySelectedWallet: wallet.isCurrent,
leadingWidget: SizedBox(
width: wallet.isCurrent ? 56 : 40,
child: Row(
children: [
wallet.isCurrent
? Container(
height: 35,
width: 6,
margin: EdgeInsets.only(right: 16),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(16),
bottomRight: Radius.circular(16),
Padding(
padding: EdgeInsets.only(left: 20, right: 20),
child: Container(
child: Observer(
builder: (_) => FilteredList(
shrinkWrap: true,
list: widget.walletListViewModel.singleWalletsList,
updateFunction: widget.walletListViewModel.reorderAccordingToWalletList,
itemBuilder: (context, index) {
final wallet = widget.walletListViewModel.singleWalletsList[index];
final currentColor = wallet.isCurrent
? Theme.of(context).colorScheme.primary
: Theme.of(context).colorScheme.surface;
return GroupedWalletExpansionTile(
tileKey: ValueKey('single_wallets_expansion_tile_widget_$index'),
isCurrentlySelectedWallet: wallet.isCurrent,
leadingWidget: SizedBox(
width: wallet.isCurrent ? 56 : 40,
child: Row(
children: [
wallet.isCurrent
? Container(
height: 35,
width: 6,
margin: EdgeInsets.only(right: 16),
decoration: BoxDecoration(
borderRadius: BorderRadius.only(
topRight: Radius.circular(16),
bottomRight: Radius.circular(16),
),
color: currentColor,
),
color: currentColor,
),
)
: SizedBox(width: 6),
Image.asset(
walletTypeToCryptoCurrency(wallet.type).iconPath!,
width: 32,
height: 32,
),
],
)
: SizedBox(width: 6),
Image.asset(
walletTypeToCryptoCurrency(wallet.type).iconPath!,
width: 32,
height: 32,
),
],
),
),
),
title: wallet.name,
isSelected: false,
borderRadius: BorderRadius.all(Radius.circular(16)),
margin: EdgeInsets.only(left: 20, right: 20, bottom: 12),
onTitleTapped: () => wallet.isCurrent ? null : _loadWallet(wallet),
trailingWidget: wallet.isCurrent
? null
: EditWalletButtonWidget(
width: 44,
onTap: () {
Navigator.of(context).pushNamed(
Routes.walletEdit,
arguments: WalletEditPageArguments(
walletListViewModel: widget.walletListViewModel,
editingWallet: wallet,
),
);
},
),
);
},
title: wallet.name,
isSelected: false,
borderRadius: BorderRadius.all(Radius.circular(16)),
margin: EdgeInsets.only(left: 20, right: 20, bottom: 12),
onTitleTapped: () => wallet.isCurrent ? null : _loadWallet(wallet),
trailingWidget: wallet.isCurrent
? null
: EditWalletButtonWidget(
width: 64,
onTap: () {
Navigator.of(context).pushNamed(
Routes.walletEdit,
arguments: WalletEditPageArguments(
walletListViewModel: widget.walletListViewModel,
editingWallet: wallet,
),
);
},
),
);
},
),
),
),
),
@@ -481,7 +467,8 @@ class WalletListBodyState extends State<WalletListBody> {
walletType: WalletType.monero,
hardwareWalletType: HardwareWalletType.ledger,
onConnectDevice: (context, ledgerVM) async {
if (ledgerVM is LedgerViewModel) monero!.setGlobalLedgerConnection(ledgerVM.connection);
if (ledgerVM is LedgerViewModel)
monero!.setGlobalLedgerConnection(ledgerVM.connection);
didConnect = true;
Navigator.of(context).pop();
},
@@ -1,6 +1,5 @@
import 'package:cake_wallet/src/widgets/cake_image_widget.dart';
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/routes.dart';
@@ -59,9 +58,7 @@ class CreatePinWelcomePage extends BasePage {
gradient: LinearGradient(
colors: [
Theme.of(context).colorScheme.surface,
currentTheme.isDark
? CustomThemeColors.backgroundGradientColorDark
: CustomThemeColors.backgroundGradientColorLight,
currentTheme.customColors.backgroundGradientColor,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
+6 -5
View File
@@ -45,7 +45,8 @@ class BaseTextFormField extends StatelessWidget {
this.borderWidth = 1.0,
this.prefixIconConstraints,
this.suffixIconConstraints,
super.key, this.suffixText,
super.key,
this.suffixText,
});
final TextEditingController? controller;
@@ -125,12 +126,12 @@ class BaseTextFormField extends StatelessWidget {
alignLabelWithHint: alignLabelWithHint,
contentPadding: contentPadding,
floatingLabelBehavior: floatingLabelBehavior ?? FloatingLabelBehavior.never,
prefixIconConstraints: prefixIconConstraints ??
const BoxConstraints(minWidth: 0, minHeight: 0),
prefixIconConstraints:
prefixIconConstraints ?? const BoxConstraints(minWidth: 40, minHeight: 0),
prefix: prefix,
prefixIcon: prefixIcon,
suffixIconConstraints: suffixIconConstraints ??
const BoxConstraints(minWidth: 0, minHeight: 0),
suffixIconConstraints:
suffixIconConstraints ?? const BoxConstraints(minWidth: 0, minHeight: 0),
suffix: suffix,
suffixIcon: suffixIcon,
filled: !hasUnderlineBorder,
@@ -37,7 +37,6 @@ class BlockchainHeightWidget extends StatefulWidget {
final Function()? toggleSingleScan;
final WalletType walletType;
final Key? blockHeightTextFieldKey;
@override
State<StatefulWidget> createState() => BlockchainHeightState();
}
@@ -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;
+5 -10
View File
@@ -1,8 +1,7 @@
import 'package:cake_wallet/themes/core/theme_extension.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import '../../themes/utils/custom_theme_colors.dart';
class DashBoardRoundedCardWidget extends StatelessWidget {
DashBoardRoundedCardWidget({
this.onTap,
@@ -19,7 +18,6 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
super.key,
this.marginV,
this.marginH,
required this.isDarkTheme,
});
final VoidCallback? onTap;
@@ -35,7 +33,6 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
final double? marginH;
final double? shadowSpread;
final double? shadowBlur;
final bool isDarkTheme;
@override
Widget build(BuildContext context) {
@@ -48,12 +45,8 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
borderRadius: BorderRadius.circular(15),
gradient: LinearGradient(
colors: [
isDarkTheme
? CustomThemeColors.cardGradientColorPrimaryDark
: CustomThemeColors.cardGradientColorPrimaryLight,
isDarkTheme
? CustomThemeColors.cardGradientColorSecondaryDark
: CustomThemeColors.cardGradientColorSecondaryLight,
context.customColors.cardGradientColorPrimary,
context.customColors.cardGradientColorSecondary,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
@@ -76,6 +69,8 @@ class DashBoardRoundedCardWidget extends StatelessWidget {
style: TextButton.styleFrom(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15),
side: BorderSide(
width: 1.25, color: Theme.of(context).colorScheme.surfaceContainerHigh),
),
padding: EdgeInsets.only(left: 24, top: 24, right: 20, bottom: 24),
),
+3 -5
View File
@@ -1,8 +1,8 @@
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
import 'package:cake_wallet/themes/core/theme_extension.dart';
import 'package:flutter/material.dart';
class GradientBackground extends StatelessWidget {
const GradientBackground({required this.scaffold});
const GradientBackground({required this.scaffold, super.key});
final Widget scaffold;
@@ -14,9 +14,7 @@ class GradientBackground extends StatelessWidget {
gradient: LinearGradient(
colors: [
Theme.of(context).colorScheme.surface,
Theme.of(context).brightness == Brightness.dark
? CustomThemeColors.backgroundGradientColorDark
: CustomThemeColors.backgroundGradientColorLight,
context.customColors.backgroundGradientColor,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
+25 -12
View File
@@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:cake_wallet/themes/core/theme_extension.dart';
class OptionTile extends StatelessWidget {
const OptionTile({
@@ -23,10 +24,22 @@ class OptionTile extends StatelessWidget {
return Container(
width: double.infinity,
alignment: Alignment.center,
child: ElevatedButton(
decoration: ShapeDecoration(
gradient: LinearGradient(
colors: [
context.customColors.cardGradientColorPrimary,
context.customColors.cardGradientColorSecondary,
],
begin: Alignment.topCenter,
end: Alignment.bottomCenter,
),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
),
child: TextButton(
style: TextButton.styleFrom(
backgroundColor: Theme.of(context).colorScheme.surfaceContainer,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(12)),
side: BorderSide(width: 1.25, color: Theme.of(context).colorScheme.surfaceContainerHigh),
backgroundColor: Colors.transparent,
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(15)),
padding: EdgeInsets.all(24),
),
onPressed: onPressed,
@@ -50,15 +63,15 @@ class OptionTile extends StatelessWidget {
constraints: BoxConstraints(maxWidth: 220),
child: Text(title, style: Theme.of(context).textTheme.titleMedium),
),
if (tag != null) Container(
decoration: BoxDecoration(
border: Border.all(),
borderRadius: BorderRadius.circular(20),
color: Theme.of(context).colorScheme.onSurfaceVariant
),
padding: EdgeInsets.symmetric(horizontal: 5),
margin: EdgeInsets.only(left: 5),
child: Text(tag!))
if (tag != null)
Container(
decoration: BoxDecoration(
border: Border.all(),
borderRadius: BorderRadius.circular(20),
color: Theme.of(context).colorScheme.onSurfaceVariant),
padding: EdgeInsets.symmetric(horizontal: 5),
margin: EdgeInsets.only(left: 5),
child: Text(tag!))
],
),
Padding(
+3 -7
View File
@@ -4,7 +4,7 @@ import 'dart:math';
import 'package:cake_wallet/entities/seed_type.dart';
import 'package:cake_wallet/src/widgets/search_bar_widget.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/responsive_layout_util.dart';
import 'package:cw_core/transaction_priority.dart';
import 'package:flutter/material.dart';
@@ -77,7 +77,6 @@ class _PickerState<Item> extends State<Picker<Item>> {
List<Image> images;
List<Item> filteredItems = [];
List<Image> filteredImages = [];
final TextEditingController searchController = TextEditingController();
ScrollController controller = ScrollController();
@@ -519,16 +518,13 @@ class _PickerState<Item> extends State<Picker<Item>> {
}
Widget buildSlider({required int index, required bool isActivated}) {
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
return Row(
children: <Widget>[
Expanded(
child: Slider(
activeColor: Theme.of(context).colorScheme.primary,
inactiveColor: isDarkMode
? CustomThemeColors.toggleColorOffStateDark
: CustomThemeColors.toggleColorOffStateLight,
thumbColor: CustomThemeColors.toggleKnobStateColorLight,
inactiveColor: context.customColors.toggleColorOffState,
thumbColor: context.customColors.toggleKnobStateColor,
value: widget.sliderValue == null || widget.sliderValue! < 1 ? 1 : widget.sliderValue!,
onChanged: isActivated ? widget.onSliderChanged : null,
min: widget.minValue ?? 1,
+9 -10
View File
@@ -46,16 +46,15 @@ class PrimaryButton extends StatelessWidget {
borderRadius: borderRadius ?? BorderRadius.circular(12.0),
),
),
overlayColor: WidgetStateProperty.all(Colors.transparent),
),
child: Text(
text,
textAlign: TextAlign.center,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 15.0,
fontWeight: FontWeight.w600,
color: isDisabled ? textColor.withOpacity(0.5) : textColor,
),
fontSize: 15.0,
fontWeight: FontWeight.w600,
color: isDisabled ? textColor.withOpacity(0.5) : textColor,
),
),
),
),
@@ -117,10 +116,10 @@ class LoadingPrimaryButton extends StatelessWidget {
: Text(
text,
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 15.0,
fontWeight: FontWeight.w600,
color: isDisabled ? textColor.withOpacity(0.5) : textColor,
),
fontSize: 15.0,
fontWeight: FontWeight.w600,
color: isDisabled ? textColor.withOpacity(0.5) : textColor,
),
),
),
),
@@ -228,7 +227,7 @@ class PrimaryImageButton extends StatelessWidget {
child: SizedBox(
width: double.infinity,
height: 52.0,
child: ElevatedButton(
child: TextButton(
onPressed: onPressed,
style: ButtonStyle(
backgroundColor: WidgetStateProperty.all(color),
+12 -8
View File
@@ -15,8 +15,12 @@ class SeedLanguagePickerOption {
}
final List<SeedLanguagePickerOption> seedLanguages = [
SeedLanguagePickerOption('English', S.current.seed_language_english,
Image.asset('assets/images/flags/usa.png'), [MoneroSeedType.legacy, MoneroSeedType.polyseed, MoneroSeedType.bip39]),
SeedLanguagePickerOption(
'English',
S.current.seed_language_english,
Image.asset('assets/images/flags/usa.png'),
[MoneroSeedType.legacy, MoneroSeedType.polyseed, MoneroSeedType.bip39],
),
SeedLanguagePickerOption('Chinese (Simplified)', S.current.seed_language_chinese,
Image.asset('assets/images/flags/chn.png'), [MoneroSeedType.legacy, MoneroSeedType.polyseed]),
SeedLanguagePickerOption('Chinese (Traditional)', S.current.seed_language_chinese_traditional,
@@ -48,12 +52,12 @@ const defaultSeedLanguage = 'English';
enum Places { topLeft, topRight, bottomLeft, bottomRight, inside }
class SeedLanguagePicker extends StatefulWidget {
SeedLanguagePicker(
{Key? key,
this.selected = defaultSeedLanguage,
this.seedType = MoneroSeedType.defaultSeedType,
required this.onItemSelected})
: super(key: key);
SeedLanguagePicker({
Key? key,
this.selected = defaultSeedLanguage,
this.seedType = MoneroSeedType.defaultSeedType,
required this.onItemSelected,
}) : super(key: key);
final MoneroSeedType seedType;
final String selected;
+5 -6
View File
@@ -1,6 +1,6 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:cake_wallet/entities/service_status.dart';
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
import 'package:cake_wallet/themes/core/custom_theme_colors.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
@@ -22,11 +22,10 @@ class ServiceStatusTile extends StatelessWidget {
child: AutoSizeText(
"${status.title}${status.status != null ? " - ${status.status}" : ""}",
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontSize: 16,
fontWeight: FontWeight.w800,
height: 1,
),
fontSize: 16,
fontWeight: FontWeight.w800,
height: 1,
),
maxLines: 1,
textAlign: TextAlign.start,
),
+3 -7
View File
@@ -43,7 +43,7 @@ class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
},
child: CakeImageWidget(
imageUrl: "assets/images/notif.svg",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).colorScheme.primary,
width: DeviceInfo.instance.isDesktop ? 30 : 20,
),
);
@@ -108,7 +108,7 @@ class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
horizontal: 24,
vertical: 20,
),
child: PrimaryImageButton(
child: PrimaryButton(
onPressed: () {
try {
launchUrl(
@@ -118,10 +118,6 @@ class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
mode: LaunchMode.externalApplication);
} catch (_) {}
},
image: Image.asset(
"assets/images/status_website_image.png",
color: Theme.of(context).colorScheme.onPrimary,
),
text: "Status Website",
color: Theme.of(context).colorScheme.primary,
textColor: Theme.of(context).colorScheme.onPrimary,
@@ -139,7 +135,7 @@ class _ServicesUpdatesWidgetState extends State<ServicesUpdatesWidget> {
children: [
CakeImageWidget(
imageUrl: "assets/images/notif.svg",
color: Theme.of(context).colorScheme.onSurface,
color: Theme.of(context).colorScheme.primary,
width: DeviceInfo.instance.isDesktop ? 30 : 20,
),
if (state.hasData && state.data!.hasUpdates && !wasOpened)
+6 -5
View File
@@ -34,7 +34,7 @@ class SettingActions {
static SettingActions silentPaymentsSettingAction = SettingActions._(
key: ValueKey('dashboard_page_menu_widget_silent_payment_settings_button_key'),
name: (context) => S.of(context).silent_payments_settings,
image: 'assets/images/bitcoin_menu.png',
image: 'assets/images/crypto/bitcoin.png',
onTap: (BuildContext context) {
Navigator.of(context).pushNamed(Routes.silentPaymentsSettings);
},
@@ -43,16 +43,17 @@ class SettingActions {
static SettingActions exportOutputsAction = SettingActions._(
key: ValueKey('dashboard_page_menu_widget_export_outputs_settings_button_key'),
name: (context) => S.of(context).export_outputs,
image: 'assets/images/monero_menu.png',
image: 'assets/images/crypto/monero.png',
onTap: (BuildContext context) {
Navigator.of(context).pushNamed(Routes.urqrAnimatedPage, arguments: {'export-outputs': 'export-outputs'});
Navigator.of(context)
.pushNamed(Routes.urqrAnimatedPage, arguments: {'export-outputs': 'export-outputs'});
},
);
static SettingActions litecoinMwebSettingAction = SettingActions._(
key: ValueKey('dashboard_page_menu_widget_litecoin_mweb_settings_button_key'),
name: (context) => S.of(context).litecoin_mweb_settings,
image: 'assets/images/litecoin_menu.png',
image: 'assets/images/crypto/litecoin.png',
onTap: (BuildContext context) {
Navigator.of(context).pushNamed(Routes.mwebSettings);
},
@@ -1,6 +1,5 @@
import 'package:cake_wallet/src/widgets/primary_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:flutter/material.dart';
class StandardSlideButton extends StatefulWidget {
@@ -9,7 +8,6 @@ class StandardSlideButton extends StatefulWidget {
required this.onSlideComplete,
this.buttonText = '',
this.height = 48.0,
required this.currentTheme,
required this.accessibleNavigationModeButtonText,
this.tileBackgroundColor,
this.knobColor,
@@ -18,11 +16,10 @@ class StandardSlideButton extends StatefulWidget {
final VoidCallback onSlideComplete;
final String buttonText;
final double height;
final MaterialThemeBase currentTheme;
final String accessibleNavigationModeButtonText;
final Color? tileBackgroundColor;
final Color? knobColor;
@override
StandardSlideButtonState createState() => StandardSlideButtonState();
}
@@ -39,9 +36,7 @@ class StandardSlideButtonState extends State<StandardSlideButton> {
Widget build(BuildContext context) {
final bool accessible = MediaQuery.of(context).accessibleNavigation;
final tileBackgroundColor = widget.currentTheme.isDark
? CustomThemeColors.backgroundGradientColorDark
: CustomThemeColors.backgroundGradientColorLight;
final tileBackgroundColor = context.currentTheme.customColors.backgroundGradientColor;
return accessible
? PrimaryButton(
+11 -12
View File
@@ -1,12 +1,16 @@
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
import 'package:cake_wallet/themes/core/theme_extension.dart';
import 'package:flutter/material.dart';
class StandardSwitch extends StatefulWidget {
const StandardSwitch({required this.value, required this.onTapped});
const StandardSwitch({
required this.value,
required this.onTapped,
this.backgroundColor,
});
final bool value;
final Color? backgroundColor;
final VoidCallback onTapped;
@override
StandardSwitchState createState() => StandardSwitchState();
}
@@ -14,7 +18,6 @@ class StandardSwitch extends StatefulWidget {
class StandardSwitchState extends State<StandardSwitch> {
@override
Widget build(BuildContext context) {
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
return Semantics(
toggled: widget.value,
child: GestureDetector(
@@ -28,20 +31,16 @@ class StandardSwitchState extends State<StandardSwitch> {
decoration: BoxDecoration(
color: widget.value
? Theme.of(context).colorScheme.primary
: isDarkMode
? CustomThemeColors.toggleColorOffStateDark
: CustomThemeColors.toggleColorOffStateLight,
borderRadius: BorderRadius.all(
Radius.circular(14.0),
),
: widget.backgroundColor ?? context.currentTheme.customColors.toggleColorOffState,
borderRadius: BorderRadius.all(Radius.circular(14.0)),
),
child: Container(
width: 24.0,
height: 24.0,
decoration: BoxDecoration(
color: isDarkMode
color: context.currentTheme.isDark
? Theme.of(context).colorScheme.surface
: CustomThemeColors.toggleKnobStateColorLight,
: context.currentTheme.customColors.toggleKnobStateColor,
shape: BoxShape.circle,
),
),
+1 -1
View File
@@ -1,4 +1,4 @@
import 'package:cake_wallet/themes/utils/custom_theme_colors.dart';
import 'package:cake_wallet/themes/core/custom_theme_colors.dart';
import 'package:flutter/material.dart';
class TemplateTile extends StatefulWidget {
+5 -12
View File
@@ -1,11 +1,9 @@
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:flutter/material.dart';
class WarningBox extends StatelessWidget {
const WarningBox({
required this.content,
required this.currentTheme,
this.showBorder = true,
this.textColor,
this.textAlign,
@@ -18,7 +16,6 @@ class WarningBox extends StatelessWidget {
});
final String content;
final MaterialThemeBase currentTheme;
final bool showBorder;
final Color? textColor;
final TextAlign? textAlign;
@@ -33,15 +30,11 @@ class WarningBox extends StatelessWidget {
return Container(
padding: padding ?? EdgeInsets.symmetric(horizontal: 12, vertical: 8),
decoration: BoxDecoration(
color: currentTheme.isDark
? CustomThemeColors.warningContainerColorDark
: CustomThemeColors.warningContainerColorLight,
color: context.customColors.warningContainerColor,
borderRadius: BorderRadius.all(Radius.circular(12)),
border: showBorder
? Border.all(
color: currentTheme.isDark
? CustomThemeColors.warningOutlineColorDark
: CustomThemeColors.warningOutlineColorLight,
color: context.customColors.warningOutlineColor,
width: 2.0,
)
: null,
@@ -53,8 +46,8 @@ class WarningBox extends StatelessWidget {
Icons.warning_amber_rounded,
size: iconSize ?? 64,
color: textColor ?? Theme.of(context).colorScheme.onSurface,
),
SizedBox(width:iconSpacing ?? 6),
),
SizedBox(width: iconSpacing ?? 6),
Expanded(
child: Text(
content,