mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-28 06:28:41 +01:00
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:
co-authored by
Omar Hatem
Blazebrain
parent
85a9e36f2e
commit
c746b85a4b
@@ -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;
|
||||
|
||||
@@ -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),
|
||||
),
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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),
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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,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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user