diff --git a/lib/main.dart b/lib/main.dart index 33fb366b6..843e348c2 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -50,7 +50,6 @@ import 'package:stackwallet/services/notifications_api.dart'; import 'package:stackwallet/services/notifications_service.dart'; import 'package:stackwallet/services/trade_service.dart'; import 'package:stackwallet/services/wallets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/db_version_migration.dart'; import 'package:stackwallet/utilities/enums/backup_frequency_type.dart'; @@ -511,11 +510,16 @@ class _MaterialAppWithThemeState extends ConsumerState title: 'Stack Wallet', onGenerateRoute: RouteGenerator.generateRoute, theme: ThemeData( - highlightColor: CFColors.splashLight, + highlightColor: StackTheme.instance.color.highlight, brightness: Brightness.light, fontFamily: GoogleFonts.inter().fontFamily, + unselectedWidgetColor: + StackTheme.instance.color.radioButtonBorderDisabled, textTheme: GoogleFonts.interTextTheme().copyWith( button: STextStyles.button, + subtitle1: STextStyles.field.copyWith( + color: StackTheme.instance.color.textDark, + ), ), radioTheme: const RadioThemeData( splashRadius: 0, @@ -523,16 +527,18 @@ class _MaterialAppWithThemeState extends ConsumerState ), // splashFactory: NoSplash.splashFactory, splashColor: Colors.transparent, - buttonTheme: const ButtonThemeData( - splashColor: CFColors.splashMed, + buttonTheme: ButtonThemeData( + splashColor: StackTheme.instance.color.splash, ), textButtonTheme: TextButtonThemeData( style: ButtonStyle( // splashFactory: NoSplash.splashFactory, - overlayColor: MaterialStateProperty.all(CFColors.splashMed), + overlayColor: + MaterialStateProperty.all(StackTheme.instance.color.splash), minimumSize: MaterialStateProperty.all(const Size(46, 46)), textStyle: MaterialStateProperty.all(STextStyles.button), - foregroundColor: MaterialStateProperty.all(CFColors.white), + foregroundColor: MaterialStateProperty.all( + StackTheme.instance.color.buttonTextSecondary), backgroundColor: MaterialStateProperty.all( StackTheme.instance.color.buttonBackSecondary), shape: MaterialStateProperty.all( @@ -543,8 +549,9 @@ class _MaterialAppWithThemeState extends ConsumerState ), ), ), - primaryColor: CFColors.stackAccent, - primarySwatch: CFColors.createMaterialColor(CFColors.stackAccent), + primaryColor: StackTheme.instance.color.accentColorDark, + primarySwatch: + Util.createMaterialColor(StackTheme.instance.color.accentColorDark), checkboxTheme: CheckboxThemeData( splashRadius: 0, shape: RoundedRectangleBorder( diff --git a/lib/notifications/notification_card.dart b/lib/notifications/notification_card.dart index 1815f5b68..4c1bdf91c 100644 --- a/lib/notifications/notification_card.dart +++ b/lib/notifications/notification_card.dart @@ -1,10 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/models/notification_model.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/format.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/rounded_container.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -43,7 +42,7 @@ class NotificationCard extends StatelessWidget { ), child: SvgPicture.asset( notification.iconAssetName, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: 24, height: 24, ), diff --git a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart index 9ed71fd4e..ac8eae5eb 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/add_wallet_view.dart @@ -6,11 +6,10 @@ import 'package:stackwallet/pages/add_wallet_views/add_wallet_view/sub_widgets/n import 'package:stackwallet/pages/add_wallet_views/add_wallet_view/sub_widgets/searchable_coin_list.dart'; import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/exit_to_my_stack_button.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart'; @@ -117,8 +116,8 @@ class _AddWalletViewState extends State { Assets.svg.search, width: 24, height: 24, - color: - CFColors.textFieldDefaultSearchIconLeft, + color: StackTheme.instance.color + .textFieldDefaultSearchIconLeft, ), ), suffixIcon: _searchFieldController.text.isNotEmpty diff --git a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart index 7b4552b4b..0f9e8bf0a 100644 --- a/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart +++ b/lib/pages/add_wallet_views/add_wallet_view/sub_widgets/coin_select_item.dart @@ -3,7 +3,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -35,7 +34,7 @@ class CoinSelectItem extends ConsumerWidget { BorderRadius.circular(Constants.size.circularBorderRadius), ), child: MaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, key: Key("coinSelectItemButtonKey_${coin.name}"), padding: isDesktop ? const EdgeInsets.only(left: 24) @@ -79,7 +78,7 @@ class CoinSelectItem extends ConsumerWidget { height: 24, child: SvgPicture.asset( Assets.svg.check, - color: CFColors.borderNormal, + color: StackTheme.instance.color.accentColorDark, ), ), ), diff --git a/lib/pages/add_wallet_views/create_or_restore_wallet_view/create_or_restore_wallet_view.dart b/lib/pages/add_wallet_views/create_or_restore_wallet_view/create_or_restore_wallet_view.dart index 124870e1b..3a3919e44 100644 --- a/lib/pages/add_wallet_views/create_or_restore_wallet_view/create_or_restore_wallet_view.dart +++ b/lib/pages/add_wallet_views/create_or_restore_wallet_view/create_or_restore_wallet_view.dart @@ -4,9 +4,8 @@ import 'package:stackwallet/pages/add_wallet_views/create_or_restore_wallet_view import 'package:stackwallet/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_or_restore_wallet_title.dart'; import 'package:stackwallet/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart'; import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/exit_to_my_stack_button.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/desktop/desktop_app_bar.dart'; @@ -82,7 +81,7 @@ class CreateOrRestoreWalletView extends StatelessWidget { ), ), body: Container( - color: CFColors.background, + color: StackTheme.instance.color.background, child: Padding( padding: const EdgeInsets.all(16), child: Column( diff --git a/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart b/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart index 16046f1a6..f8efe8166 100644 --- a/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart +++ b/lib/pages/add_wallet_views/create_or_restore_wallet_view/sub_widgets/create_wallet_button_group.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:stackwallet/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/enums/add_wallet_type_enum.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -71,8 +70,7 @@ class CreateWalletButtonGroup extends StatelessWidget { style: isDesktop ? STextStyles.desktopButtonSecondaryEnabled : STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme.instance.color.accentColorDark), ), ), ), diff --git a/lib/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart b/lib/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart index 81fdbaf06..0abb2a0d4 100644 --- a/lib/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart +++ b/lib/pages/add_wallet_views/name_your_wallet_view/name_your_wallet_view.dart @@ -266,7 +266,7 @@ class _NameYourWalletViewState extends ConsumerState { "Roll the dice to pick a random name.", style: isDesktop ? STextStyles.desktopTextExtraSmall.copyWith( - color: CFColors.textSubtitle1, + color: StackTheme.instance.color.textSubtitle1, ) : STextStyles.itemSubtitle, ), diff --git a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/new_wallet_recovery_phrase_view.dart b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/new_wallet_recovery_phrase_view.dart index 797664710..6fcca4428 100644 --- a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/new_wallet_recovery_phrase_view.dart +++ b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/new_wallet_recovery_phrase_view.dart @@ -158,7 +158,7 @@ class _NewWalletRecoveryPhraseViewState ], ), body: Container( - color: CFColors.background, + color: StackTheme.instance.color.background, width: isDesktop ? 600 : null, child: Padding( padding: isDesktop @@ -195,8 +195,8 @@ class _NewWalletRecoveryPhraseViewState Container( decoration: BoxDecoration( color: isDesktop - ? CFColors.background - : CFColors.popupBackground, + ? StackTheme.instance.color.background + : StackTheme.instance.color.popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius), ), @@ -210,8 +210,8 @@ class _NewWalletRecoveryPhraseViewState style: isDesktop ? STextStyles.desktopSubtitleH2 : STextStyles.label.copyWith( - color: CFColors.stackAccent, - ), + color: + StackTheme.instance.color.accentColorDark), ), ), ), diff --git a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table_item.dart b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table_item.dart index 495823eb5..21e7d2547 100644 --- a/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table_item.dart +++ b/lib/pages/add_wallet_views/new_wallet_recovery_phrase_view/sub_widgets/mnemonic_table_item.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; class MnemonicTableItem extends StatelessWidget { @@ -30,10 +29,10 @@ class MnemonicTableItem extends StatelessWidget { number.toString(), style: isDesktop ? STextStyles.desktopTextExtraSmall.copyWith( - color: CFColors.gray3, + color: StackTheme.instance.color.textSubtitle2, ) : STextStyles.baseXS.copyWith( - color: CFColors.gray3, + color: StackTheme.instance.color.textSubtitle2, fontSize: 10, ), ), @@ -44,7 +43,7 @@ class MnemonicTableItem extends StatelessWidget { word, style: isDesktop ? STextStyles.desktopTextExtraSmall.copyWith( - color: CFColors.textDark, + color: StackTheme.instance.color.textDark, ) : STextStyles.baseXS, ), diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart index 98453fc3e..33ca78a46 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/restore_options_view.dart @@ -12,7 +12,6 @@ import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/restore_w import 'package:stackwallet/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart'; import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/format.dart'; @@ -72,7 +71,7 @@ class _RestoreOptionsViewState extends ConsumerState { } final _datePickerTextStyleBase = GoogleFonts.inter( - color: CFColors.gray3, + color: StackTheme.instance.color.textSubtitle2, fontSize: 12, fontWeight: FontWeight.w400, letterSpacing: 0.5, @@ -80,34 +79,34 @@ class _RestoreOptionsViewState extends ConsumerState { MaterialRoundedDatePickerStyle _buildDatePickerStyle() { return MaterialRoundedDatePickerStyle( paddingMonthHeader: const EdgeInsets.only(top: 11), - colorArrowNext: CFColors.neutral60, - colorArrowPrevious: CFColors.neutral60, + colorArrowNext: StackTheme.instance.color.textSubtitle1, + colorArrowPrevious: StackTheme.instance.color.textSubtitle1, textStyleButtonNegative: _datePickerTextStyleBase.copyWith( fontSize: 16, fontWeight: FontWeight.w600), textStyleButtonPositive: _datePickerTextStyleBase.copyWith( fontSize: 16, fontWeight: FontWeight.w600), textStyleCurrentDayOnCalendar: _datePickerTextStyleBase.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, ), textStyleDayHeader: _datePickerTextStyleBase.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, fontSize: 16, fontWeight: FontWeight.w600, ), textStyleDayOnCalendar: _datePickerTextStyleBase, textStyleDayOnCalendarDisabled: _datePickerTextStyleBase.copyWith( - color: CFColors.neutral80, + color: StackTheme.instance.color.textSubtitle3, ), textStyleDayOnCalendarSelected: _datePickerTextStyleBase.copyWith( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, ), textStyleMonthYearHeader: _datePickerTextStyleBase.copyWith( - color: CFColors.neutral60, + color: StackTheme.instance.color.textSubtitle1, fontSize: 16, fontWeight: FontWeight.w600, ), textStyleYearButton: _datePickerTextStyleBase.copyWith( - color: CFColors.white, + color: StackTheme.instance.color.textWhite, fontSize: 16, fontWeight: FontWeight.w600, ), @@ -118,12 +117,12 @@ class _RestoreOptionsViewState extends ConsumerState { MaterialRoundedYearPickerStyle _buildYearPickerStyle() { return MaterialRoundedYearPickerStyle( textStyleYear: _datePickerTextStyleBase.copyWith( - color: CFColors.gray3, + color: StackTheme.instance.color.textSubtitle2, fontWeight: FontWeight.w600, fontSize: 16, ), textStyleYearSelected: _datePickerTextStyleBase.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, fontWeight: FontWeight.w600, fontSize: 18, ), @@ -165,7 +164,8 @@ class _RestoreOptionsViewState extends ConsumerState { initialDate: DateTime.now(), height: height * 0.5, theme: ThemeData( - primarySwatch: CFColors.createMaterialColor(CFColors.stackAccent), + primarySwatch: + Util.createMaterialColor(StackTheme.instance.color.accentColorDark), ), //TODO pick a better initial date // 2007 chosen as that is just before bitcoin launched @@ -292,7 +292,7 @@ class _RestoreOptionsViewState extends ConsumerState { "Choose the date you made the wallet (approximate is fine)", style: isDesktop ? STextStyles.desktopTextExtraSmall.copyWith( - color: CFColors.textSubtitle1, + color: StackTheme.instance.color.textSubtitle1, ) : STextStyles.smallMed12.copyWith( fontSize: 10, diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/mobile_mnemonic_length_selector.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/mobile_mnemonic_length_selector.dart index e961158f3..79fece250 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/mobile_mnemonic_length_selector.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/mobile_mnemonic_length_selector.dart @@ -3,10 +3,9 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; class MobileMnemonicLengthSelector extends ConsumerWidget { const MobileMnemonicLengthSelector({ @@ -30,7 +29,7 @@ class MobileMnemonicLengthSelector extends ConsumerWidget { horizontal: 12, ), child: RawMaterialButton( - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -48,7 +47,7 @@ class MobileMnemonicLengthSelector extends ConsumerWidget { Assets.svg.chevronDown, width: 8, height: 4, - color: CFColors.gray3, + color: StackTheme.instance.color.textSubtitle2, ), ], ), diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_from_date_picker.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_from_date_picker.dart index b08d4177b..e0ab01217 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_from_date_picker.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_from_date_picker.dart @@ -1,9 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; class RestoreFromDatePicker extends StatefulWidget { const RestoreFromDatePicker({Key? key, required this.onTap}) @@ -51,7 +50,7 @@ class _RestoreFromDatePickerState extends State { ), SvgPicture.asset( Assets.svg.calendar, - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, width: 16, height: 16, ), diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_platform_layout.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_platform_layout.dart index 6a6cc3950..df5223c88 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_platform_layout.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_options_view/sub_widgets/restore_options_platform_layout.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; class RestoreOptionsPlatformLayout extends StatelessWidget { @@ -18,7 +17,7 @@ class RestoreOptionsPlatformLayout extends StatelessWidget { return child; } else { return Container( - color: CFColors.background, + color: StackTheme.instance.color.background, child: Padding( padding: const EdgeInsets.all(16), child: LayoutBuilder( diff --git a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart index 8e529a2ba..59ce94874 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/restore_wallet_view.dart @@ -24,7 +24,6 @@ import 'package:stackwallet/services/transaction_notification_tracker.dart'; import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/barcode_scanner_interface.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/custom_text_selection_controls.dart'; @@ -356,7 +355,7 @@ class _RestoreWalletViewState extends ConsumerState { switch (status) { case FormInputStatus.empty: color = StackTheme.instance.color.textFieldDefaultBG; - prefixColor = CFColors.gray3; + prefixColor = StackTheme.instance.color.textSubtitle2; break; case FormInputStatus.invalid: color = StackTheme.instance.color.textFieldErrorBG; @@ -549,10 +548,10 @@ class _RestoreWalletViewState extends ConsumerState { size: 36, shadows: const [], color: StackTheme.instance.color.background, - icon: const QrCodeIcon( + icon: QrCodeIcon( width: 20, height: 20, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, ), onPressed: scanMnemonicQr, ), @@ -571,10 +570,10 @@ class _RestoreWalletViewState extends ConsumerState { size: 36, shadows: const [], color: StackTheme.instance.color.background, - icon: const ClipboardIcon( + icon: ClipboardIcon( width: 20, height: 20, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, ), onPressed: pasteMnemonic, ), diff --git a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart index 5005ec730..66593b0d2 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/mnemonic_word_count_select_sheet.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/ui/verify_recovery_phrase/mnemonic_word_count_state_provider.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; @@ -23,9 +22,9 @@ class MnemonicWordCountSelectSheet extends ConsumerWidget { return false; }, child: Container( - decoration: const BoxDecoration( - color: CFColors.white, - borderRadius: BorderRadius.vertical( + decoration: BoxDecoration( + color: StackTheme.instance.color.popupBG, + borderRadius: const BorderRadius.vertical( top: Radius.circular(20), ), ), diff --git a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart index 33b288b0c..a3971196f 100644 --- a/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart +++ b/lib/pages/add_wallet_views/restore_wallet_view/sub_widgets/restoring_dialog.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/stack_dialog.dart'; @@ -60,12 +59,10 @@ class _RestoringDialogState extends State message: "This may take a while. Please do not exit this screen.", icon: RotationTransition( turns: _spinAnimation, - child: SvgPicture.asset( - Assets.svg.arrowRotate3, - width: 24, - height: 24, - color: CFColors.stackAccent, - ), + child: SvgPicture.asset(Assets.svg.arrowRotate3, + width: 24, + height: 24, + color: StackTheme.instance.color.accentColorDark), ), rightButton: TextButton( style: StackTheme.instance.getSecondaryEnabledButtonColor(context), diff --git a/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart b/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart index b103349ac..a9c86b525 100644 --- a/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart +++ b/lib/pages/add_wallet_views/verify_recovery_phrase_view/sub_widgets/word_table_item.dart @@ -1,10 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; class WordTableItem extends ConsumerWidget { const WordTableItem({ @@ -25,13 +24,15 @@ class WordTableItem extends ConsumerWidget { ref.watch(verifyMnemonicSelectedWordStateProvider.state).state; return Container( decoration: BoxDecoration( - color: selectedWord == word ? CFColors.selection : CFColors.white, + color: selectedWord == word + ? StackTheme.instance.color.snackBarBackInfo + : StackTheme.instance.color.popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), ), child: MaterialButton( - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, key: Key("coinSelectItemButtonKey_$word"), padding: isDesktop ? const EdgeInsets.symmetric( @@ -55,7 +56,7 @@ class WordTableItem extends ConsumerWidget { textAlign: TextAlign.center, style: isDesktop ? STextStyles.desktopTextExtraSmall.copyWith( - color: CFColors.textDark, + color: StackTheme.instance.color.textDark, ) : STextStyles.baseXS, ), diff --git a/lib/pages/address_book_views/address_book_view.dart b/lib/pages/address_book_views/address_book_view.dart index 1b78e496f..286971b97 100644 --- a/lib/pages/address_book_views/address_book_view.dart +++ b/lib/pages/address_book_views/address_book_view.dart @@ -9,11 +9,10 @@ import 'package:stackwallet/providers/global/address_book_service_provider.dart' import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/ui/address_book_providers/address_book_filter_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/address_book_card.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/icon_widgets/x_icon.dart'; @@ -130,7 +129,7 @@ class _AddressBookViewState extends ConsumerState { color: StackTheme.instance.color.background, icon: SvgPicture.asset( Assets.svg.filter, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: 20, height: 20, ), @@ -157,7 +156,7 @@ class _AddressBookViewState extends ConsumerState { color: StackTheme.instance.color.background, icon: SvgPicture.asset( Assets.svg.plus, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: 20, height: 20, ), diff --git a/lib/pages/address_book_views/subviews/add_address_book_entry_view.dart b/lib/pages/address_book_views/subviews/add_address_book_entry_view.dart index 6ff9a589e..808a3bb48 100644 --- a/lib/pages/address_book_views/subviews/add_address_book_entry_view.dart +++ b/lib/pages/address_book_views/subviews/add_address_book_entry_view.dart @@ -11,7 +11,6 @@ import 'package:stackwallet/providers/ui/address_book_providers/contact_name_is_ import 'package:stackwallet/providers/ui/address_book_providers/valid_contact_state_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/barcode_scanner_interface.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -223,20 +222,22 @@ class _AddAddressBookEntryViewState height: 14, width: 14, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(14), - color: CFColors.stackAccent, - ), + borderRadius: BorderRadius.circular(14), + color: StackTheme + .instance.color.accentColorDark), child: Center( child: _selectedEmoji == null ? SvgPicture.asset( Assets.svg.plus, - color: CFColors.white, + color: StackTheme + .instance.color.textWhite, width: 12, height: 12, ) : SvgPicture.asset( Assets.svg.thickX, - color: CFColors.white, + color: StackTheme + .instance.color.textWhite, width: 8, height: 8, ), @@ -345,8 +346,8 @@ class _AddAddressBookEntryViewState child: Text( "Cancel", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme + .instance.color.accentColorDark), ), onPressed: () async { if (FocusScope.of(context).hasFocus) { diff --git a/lib/pages/address_book_views/subviews/add_new_contact_address_view.dart b/lib/pages/address_book_views/subviews/add_new_contact_address_view.dart index a03e5ec2d..7c590878b 100644 --- a/lib/pages/address_book_views/subviews/add_new_contact_address_view.dart +++ b/lib/pages/address_book_views/subviews/add_new_contact_address_view.dart @@ -9,7 +9,6 @@ import 'package:stackwallet/providers/ui/address_book_providers/address_entry_da import 'package:stackwallet/providers/ui/address_book_providers/valid_contact_state_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/barcode_scanner_interface.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; @@ -151,8 +150,8 @@ class _AddNewContactAddressViewState child: Text( "Cancel", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme + .instance.color.accentColorDark), ), onPressed: () async { if (FocusScope.of(context).hasFocus) { diff --git a/lib/pages/address_book_views/subviews/coin_select_sheet.dart b/lib/pages/address_book_views/subviews/coin_select_sheet.dart index 76e4fb078..a74bfda8d 100644 --- a/lib/pages/address_book_views/subviews/coin_select_sheet.dart +++ b/lib/pages/address_book_views/subviews/coin_select_sheet.dart @@ -3,7 +3,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/providers/global/prefs_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -18,9 +17,9 @@ class CoinSelectSheet extends StatelessWidget { var coins_ = [...Coin.values]; coins_.remove(Coin.firoTestNet); return Container( - decoration: const BoxDecoration( - color: CFColors.white, - borderRadius: BorderRadius.vertical( + decoration: BoxDecoration( + color: StackTheme.instance.color.popupBG, + borderRadius: const BorderRadius.vertical( top: Radius.circular(20), ), ), @@ -78,7 +77,7 @@ class CoinSelectSheet extends StatelessWidget { return Padding( padding: const EdgeInsets.symmetric(vertical: 4), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, onPressed: () { Navigator.of(context).pop(coin); }, diff --git a/lib/pages/address_book_views/subviews/contact_details_view.dart b/lib/pages/address_book_views/subviews/contact_details_view.dart index ca889db88..b74d9d693 100644 --- a/lib/pages/address_book_views/subviews/contact_details_view.dart +++ b/lib/pages/address_book_views/subviews/contact_details_view.dart @@ -13,7 +13,6 @@ import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/ui/address_book_providers/address_entry_data_provider.dart'; import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; @@ -164,7 +163,7 @@ class _ContactDetailsViewState extends ConsumerState { color: StackTheme.instance.color.background, icon: SvgPicture.asset( Assets.svg.trash, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: 20, height: 20, ), @@ -279,12 +278,11 @@ class _ContactDetailsViewState extends ConsumerState { padding: const EdgeInsets.symmetric(horizontal: 12), child: Row( children: [ - SvgPicture.asset( - Assets.svg.pencil, - width: 10, - height: 10, - color: CFColors.stackAccent, - ), + SvgPicture.asset(Assets.svg.pencil, + width: 10, + height: 10, + color: + StackTheme.instance.color.accentColorDark), const SizedBox( width: 4, ), @@ -382,12 +380,11 @@ class _ContactDetailsViewState extends ConsumerState { color: StackTheme .instance.color.textFieldDefaultBG, padding: const EdgeInsets.all(4), - child: SvgPicture.asset( - Assets.svg.pencil, - width: 12, - height: 12, - color: CFColors.stackAccent, - ), + child: SvgPicture.asset(Assets.svg.pencil, + width: 12, + height: 12, + color: StackTheme + .instance.color.accentColorDark), ), ), const SizedBox( @@ -409,12 +406,11 @@ class _ContactDetailsViewState extends ConsumerState { color: StackTheme .instance.color.textFieldDefaultBG, padding: const EdgeInsets.all(4), - child: SvgPicture.asset( - Assets.svg.copy, - width: 12, - height: 12, - color: CFColors.stackAccent, - ), + child: SvgPicture.asset(Assets.svg.copy, + width: 12, + height: 12, + color: StackTheme + .instance.color.accentColorDark), ), ), ], diff --git a/lib/pages/address_book_views/subviews/contact_popup.dart b/lib/pages/address_book_views/subviews/contact_popup.dart index 553909f32..b8e1e735a 100644 --- a/lib/pages/address_book_views/subviews/contact_popup.dart +++ b/lib/pages/address_book_views/subviews/contact_popup.dart @@ -10,7 +10,6 @@ import 'package:stackwallet/providers/exchange/exchange_flow_is_active_state_pro import 'package:stackwallet/providers/global/address_book_service_provider.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; @@ -72,7 +71,7 @@ class ContactPopUp extends ConsumerWidget { ), child: Container( decoration: BoxDecoration( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, borderRadius: BorderRadius.circular( 20, ), @@ -259,11 +258,11 @@ class ContactPopUp extends ConsumerWidget { .textFieldDefaultBG, padding: const EdgeInsets.all(4), child: SvgPicture.asset( - Assets.svg.copy, - width: 12, - height: 12, - color: CFColors.stackAccent, - ), + Assets.svg.copy, + width: 12, + height: 12, + color: StackTheme.instance + .color.accentColorDark), ), ), ], @@ -311,11 +310,12 @@ class ContactPopUp extends ConsumerWidget { padding: const EdgeInsets.all(4), child: SvgPicture.asset( - Assets.svg.circleArrowUpRight, - width: 12, - height: 12, - color: CFColors.stackAccent, - ), + Assets + .svg.circleArrowUpRight, + width: 12, + height: 12, + color: StackTheme.instance + .color.accentColorDark), ), ), ], diff --git a/lib/pages/address_book_views/subviews/edit_contact_address_view.dart b/lib/pages/address_book_views/subviews/edit_contact_address_view.dart index 79ee937f6..fb4527f27 100644 --- a/lib/pages/address_book_views/subviews/edit_contact_address_view.dart +++ b/lib/pages/address_book_views/subviews/edit_contact_address_view.dart @@ -9,7 +9,6 @@ import 'package:stackwallet/providers/ui/address_book_providers/address_entry_da import 'package:stackwallet/providers/ui/address_book_providers/valid_contact_state_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/barcode_scanner_interface.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; @@ -186,8 +185,8 @@ class _EditContactAddressViewState child: Text( "Cancel", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme + .instance.color.accentColorDark), ), onPressed: () async { if (FocusScope.of(context).hasFocus) { diff --git a/lib/pages/address_book_views/subviews/edit_contact_name_emoji_view.dart b/lib/pages/address_book_views/subviews/edit_contact_name_emoji_view.dart index 5151937f1..bc9b2a5b2 100644 --- a/lib/pages/address_book_views/subviews/edit_contact_name_emoji_view.dart +++ b/lib/pages/address_book_views/subviews/edit_contact_name_emoji_view.dart @@ -4,7 +4,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/providers/global/address_book_service_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; @@ -162,20 +161,22 @@ class _EditContactNameEmojiViewState height: 14, width: 14, decoration: BoxDecoration( - borderRadius: BorderRadius.circular(14), - color: CFColors.stackAccent, - ), + borderRadius: BorderRadius.circular(14), + color: StackTheme + .instance.color.accentColorDark), child: Center( child: _selectedEmoji == null ? SvgPicture.asset( Assets.svg.plus, - color: CFColors.white, + color: StackTheme + .instance.color.textWhite, width: 12, height: 12, ) : SvgPicture.asset( Assets.svg.thickX, - color: CFColors.white, + color: StackTheme + .instance.color.textWhite, width: 8, height: 8, ), @@ -237,8 +238,8 @@ class _EditContactNameEmojiViewState child: Text( "Cancel", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme + .instance.color.accentColorDark), ), onPressed: () async { if (FocusScope.of(context).hasFocus) { diff --git a/lib/pages/address_book_views/subviews/new_contact_address_entry_form.dart b/lib/pages/address_book_views/subviews/new_contact_address_entry_form.dart index 353c67a7e..21ec46685 100644 --- a/lib/pages/address_book_views/subviews/new_contact_address_entry_form.dart +++ b/lib/pages/address_book_views/subviews/new_contact_address_entry_form.dart @@ -9,7 +9,6 @@ import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/barcode_scanner_interface.dart'; import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -82,7 +81,7 @@ class _NewContactAddressEntryFormState child: Padding( padding: const EdgeInsets.symmetric(horizontal: 12), child: RawMaterialButton( - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -136,7 +135,7 @@ class _NewContactAddressEntryFormState Assets.svg.chevronDown, width: 8, height: 4, - color: CFColors.gray3, + color: StackTheme.instance.color.textSubtitle2, ), ], ), diff --git a/lib/pages/exchange_view/confirm_change_now_send.dart b/lib/pages/exchange_view/confirm_change_now_send.dart index 951d92217..5209d6fd6 100644 --- a/lib/pages/exchange_view/confirm_change_now_send.dart +++ b/lib/pages/exchange_view/confirm_change_now_send.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/models/exchange/change_now/exchange_transaction.dart'; @@ -8,7 +10,6 @@ import 'package:stackwallet/pages/wallet_view/wallet_view.dart'; import 'package:stackwallet/providers/exchange/trade_sent_from_stack_lookup_provider.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/route_generator.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/format.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -48,14 +49,14 @@ class _ConfirmChangeNowSendViewState late final ExchangeTransaction trade; Future _attemptSend(BuildContext context) async { - showDialog( + unawaited(showDialog( context: context, useSafeArea: false, barrierDismissible: false, builder: (context) { return const SendingTransactionDialog(); }, - ); + )); final String note = transactionInfo["note"] as String? ?? ""; final manager = @@ -63,10 +64,10 @@ class _ConfirmChangeNowSendViewState try { final txid = await manager.confirmSend(txData: transactionInfo); - manager.refresh(); + unawaited(manager.refresh()); // save note - ref + await ref .read(notesServiceChangeNotifierProvider(walletId)) .editOrAddNote(txid: txid, note: note); @@ -101,7 +102,7 @@ class _ConfirmChangeNowSendViewState child: Text( "Ok", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.buttonTextSecondary, ), ), onPressed: () { @@ -346,13 +347,8 @@ class _ConfirmChangeNowSendViewState ), const Spacer(), TextButton( - style: - Theme.of(context).textButtonTheme.style?.copyWith( - backgroundColor: - MaterialStateProperty.all( - CFColors.stackAccent, - ), - ), + style: StackTheme.instance + .getPrimaryEnabledButtonColor(context), onPressed: () async { final unlocked = await Navigator.push( context, @@ -376,7 +372,7 @@ class _ConfirmChangeNowSendViewState ); if (unlocked is bool && unlocked && mounted) { - _attemptSend(context); + await _attemptSend(context); } }, child: Text( diff --git a/lib/pages/exchange_view/edit_trade_note_view.dart b/lib/pages/exchange_view/edit_trade_note_view.dart index 6b05782a7..db166b01c 100644 --- a/lib/pages/exchange_view/edit_trade_note_view.dart +++ b/lib/pages/exchange_view/edit_trade_note_view.dart @@ -1,10 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/exchange/trade_note_service_provider.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/icon_widgets/x_icon.dart'; import 'package:stackwallet/widgets/stack_text_field.dart'; @@ -127,13 +126,8 @@ class _EditNoteViewState extends ConsumerState { Navigator.of(context).pop(); } }, - style: - Theme.of(context).textButtonTheme.style?.copyWith( - backgroundColor: - MaterialStateProperty.all( - CFColors.stackAccent, - ), - ), + style: StackTheme.instance + .getPrimaryEnabledButtonColor(context), child: Text( "Save", style: STextStyles.button, diff --git a/lib/pages/exchange_view/exchange_coin_selection/fixed_rate_pair_coin_selection_view.dart b/lib/pages/exchange_view/exchange_coin_selection/fixed_rate_pair_coin_selection_view.dart index 0ca059392..f660e362e 100644 --- a/lib/pages/exchange_view/exchange_coin_selection/fixed_rate_pair_coin_selection_view.dart +++ b/lib/pages/exchange_view/exchange_coin_selection/fixed_rate_pair_coin_selection_view.dart @@ -4,11 +4,10 @@ import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/models/exchange/change_now/currency.dart'; import 'package:stackwallet/models/exchange/change_now/fixed_rate_market.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/icon_widgets/x_icon.dart'; import 'package:stackwallet/widgets/loading_indicator.dart'; @@ -233,12 +232,12 @@ class _FixedRateMarketPairCoinSelectionViewState child: Row( children: [ SizedBox( - width: 20, - height: 20, + width: 24, + height: 24, child: SvgPicture.network( tuple.item1, - width: 20, - height: 20, + width: 24, + height: 24, placeholderBuilder: (_) => const LoadingIndicator(), ), @@ -246,9 +245,26 @@ class _FixedRateMarketPairCoinSelectionViewState const SizedBox( width: 10, ), - Text( - "${tuple.item2} / ${ticker.toUpperCase()}", - style: STextStyles.titleBold12, + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + tuple.item2, + style: STextStyles.largeMedium14, + ), + const SizedBox( + height: 2, + ), + Text( + ticker.toUpperCase(), + style: STextStyles.smallMed12.copyWith( + color: StackTheme + .instance.color.textSubtitle1, + ), + ), + ], + ), ), ], ), @@ -290,12 +306,12 @@ class _FixedRateMarketPairCoinSelectionViewState child: Row( children: [ SizedBox( - width: 20, - height: 20, + width: 24, + height: 24, child: SvgPicture.network( tuple.item1, - width: 20, - height: 20, + width: 24, + height: 24, placeholderBuilder: (_) => const LoadingIndicator(), ), @@ -303,9 +319,26 @@ class _FixedRateMarketPairCoinSelectionViewState const SizedBox( width: 10, ), - Text( - "${tuple.item2} / ${ticker.toUpperCase()}", - style: STextStyles.titleBold12, + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + tuple.item2, + style: STextStyles.largeMedium14, + ), + const SizedBox( + height: 2, + ), + Text( + ticker.toUpperCase(), + style: STextStyles.smallMed12.copyWith( + color: StackTheme + .instance.color.textSubtitle1, + ), + ), + ], + ), ), ], ), diff --git a/lib/pages/exchange_view/exchange_coin_selection/floating_rate_currency_selection_view.dart b/lib/pages/exchange_view/exchange_coin_selection/floating_rate_currency_selection_view.dart index bca9ffd84..522e0e041 100644 --- a/lib/pages/exchange_view/exchange_coin_selection/floating_rate_currency_selection_view.dart +++ b/lib/pages/exchange_view/exchange_coin_selection/floating_rate_currency_selection_view.dart @@ -2,11 +2,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/models/exchange/change_now/currency.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/icon_widgets/x_icon.dart'; import 'package:stackwallet/widgets/loading_indicator.dart'; @@ -140,6 +139,7 @@ class _FloatingRateCurrencySelectionViewState setState(() { _searchController.text = ""; }); + filter(""); }, ), ], @@ -184,12 +184,12 @@ class _FloatingRateCurrencySelectionViewState child: Row( children: [ SizedBox( - width: 20, - height: 20, + width: 24, + height: 24, child: SvgPicture.network( items[index].image, - width: 20, - height: 20, + width: 24, + height: 24, placeholderBuilder: (_) => const LoadingIndicator(), ), @@ -197,9 +197,26 @@ class _FloatingRateCurrencySelectionViewState const SizedBox( width: 10, ), - Text( - "${items[index].name} / ${items[index].ticker.toUpperCase()}", - style: STextStyles.titleBold12, + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + items[index].name, + style: STextStyles.largeMedium14, + ), + const SizedBox( + height: 2, + ), + Text( + items[index].ticker.toUpperCase(), + style: STextStyles.smallMed12.copyWith( + color: StackTheme + .instance.color.textSubtitle1, + ), + ), + ], + ), ), ], ), @@ -237,12 +254,12 @@ class _FloatingRateCurrencySelectionViewState child: Row( children: [ SizedBox( - width: 20, - height: 20, + width: 24, + height: 24, child: SvgPicture.network( _currencies[index].image, - width: 20, - height: 20, + width: 24, + height: 24, placeholderBuilder: (_) => const LoadingIndicator(), ), @@ -250,9 +267,26 @@ class _FloatingRateCurrencySelectionViewState const SizedBox( width: 10, ), - Text( - "${_currencies[index].name} / ${_currencies[index].ticker.toUpperCase()}", - style: STextStyles.titleBold12, + Expanded( + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + _currencies[index].name, + style: STextStyles.largeMedium14, + ), + const SizedBox( + height: 2, + ), + Text( + _currencies[index].ticker.toUpperCase(), + style: STextStyles.smallMed12.copyWith( + color: StackTheme + .instance.color.textSubtitle1, + ), + ), + ], + ), ), ], ), diff --git a/lib/pages/exchange_view/exchange_loading_overlay.dart b/lib/pages/exchange_view/exchange_loading_overlay.dart index e1a9deb5c..ad05fea5a 100644 --- a/lib/pages/exchange_view/exchange_loading_overlay.dart +++ b/lib/pages/exchange_view/exchange_loading_overlay.dart @@ -1,9 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/exchange/changenow_initial_load_status.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_loading_overlay.dart'; import 'package:stackwallet/widgets/stack_dialog.dart'; @@ -66,7 +65,7 @@ class _ExchangeLoadingOverlayViewState if (_statusEst == ChangeNowLoadStatus.loading || (_statusFixed == ChangeNowLoadStatus.loading && userReloaded)) Container( - color: CFColors.stackAccent.withOpacity(0.7), + color: StackTheme.instance.color.overlay.withOpacity(0.7), child: const CustomLoadingOverlay( message: "Loading ChangeNOW data", eventBus: null), ), @@ -75,7 +74,7 @@ class _ExchangeLoadingOverlayViewState _statusEst != ChangeNowLoadStatus.loading && _statusFixed != ChangeNowLoadStatus.loading) Container( - color: CFColors.stackAccent.withOpacity(0.7), + color: StackTheme.instance.color.overlay.withOpacity(0.7), child: Column( mainAxisAlignment: MainAxisAlignment.end, children: [ @@ -84,10 +83,13 @@ class _ExchangeLoadingOverlayViewState message: "ChangeNOW requires a working internet connection. Tap OK to try fetching again.", rightButton: TextButton( + style: StackTheme.instance + .getSecondaryEnabledButtonColor(context), child: Text( "OK", - style: STextStyles.button - .copyWith(color: CFColors.stackAccent), + style: STextStyles.button.copyWith( + color: StackTheme.instance.color.buttonTextSecondary, + ), ), onPressed: () { userReloaded = true; diff --git a/lib/pages/exchange_view/exchange_step_views/step_1_view.dart b/lib/pages/exchange_view/exchange_step_views/step_1_view.dart index 5acad73da..072c4b536 100644 --- a/lib/pages/exchange_view/exchange_step_views/step_1_view.dart +++ b/lib/pages/exchange_view/exchange_step_views/step_1_view.dart @@ -3,10 +3,9 @@ import 'package:stackwallet/models/exchange/incomplete_exchange.dart'; import 'package:stackwallet/pages/exchange_view/exchange_step_views/step_2_view.dart'; import 'package:stackwallet/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart'; import 'package:stackwallet/pages/exchange_view/sub_widgets/step_row.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -103,11 +102,15 @@ class _Step1ViewState extends State { children: [ Text( "You send", - style: STextStyles.itemSubtitle, + style: STextStyles.itemSubtitle.copyWith( + color: + StackTheme.instance.color.infoItemText), ), Text( - "${model.sendAmount.toStringAsFixed(8)} ${model.sendTicker}", - style: STextStyles.itemSubtitle12, + "${model.sendAmount.toStringAsFixed(8)} ${model.sendTicker.toUpperCase()}", + style: STextStyles.itemSubtitle12.copyWith( + color: + StackTheme.instance.color.infoItemText), ), ], ), @@ -121,11 +124,15 @@ class _Step1ViewState extends State { children: [ Text( "You receive", - style: STextStyles.itemSubtitle, + style: STextStyles.itemSubtitle.copyWith( + color: + StackTheme.instance.color.infoItemText), ), Text( - "~${model.receiveAmount.toStringAsFixed(8)} ${model.receiveTicker}", - style: STextStyles.itemSubtitle12, + "~${model.receiveAmount.toStringAsFixed(8)} ${model.receiveTicker.toUpperCase()}", + style: STextStyles.itemSubtitle12.copyWith( + color: + StackTheme.instance.color.infoItemText), ), ], ), @@ -141,11 +148,16 @@ class _Step1ViewState extends State { model.rateType == ExchangeRateType.estimated ? "Estimated rate" : "Fixed rate", - style: STextStyles.itemSubtitle, + style: STextStyles.itemSubtitle.copyWith( + color: + StackTheme.instance.color.infoItemLabel, + ), ), Text( model.rateInfo, - style: STextStyles.itemSubtitle12, + style: STextStyles.itemSubtitle12.copyWith( + color: + StackTheme.instance.color.infoItemText), ), ], ), @@ -159,13 +171,8 @@ class _Step1ViewState extends State { Navigator.of(context).pushNamed(Step2View.routeName, arguments: model); }, - style: - Theme.of(context).textButtonTheme.style?.copyWith( - backgroundColor: - MaterialStateProperty.all( - CFColors.stackAccent, - ), - ), + style: StackTheme.instance + .getPrimaryEnabledButtonColor(context), child: Text( "Next", style: STextStyles.button, diff --git a/lib/pages/exchange_view/exchange_step_views/step_2_view.dart b/lib/pages/exchange_view/exchange_step_views/step_2_view.dart index 9722680de..131242b98 100644 --- a/lib/pages/exchange_view/exchange_step_views/step_2_view.dart +++ b/lib/pages/exchange_view/exchange_step_views/step_2_view.dart @@ -10,13 +10,12 @@ import 'package:stackwallet/providers/exchange/exchange_send_from_wallet_id_prov import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/barcode_scanner_interface.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/icon_widgets/addressbook_icon.dart'; import 'package:stackwallet/widgets/icon_widgets/clipboard_icon.dart'; @@ -157,9 +156,7 @@ class _Step2ViewState extends ConsumerState { children: [ Text( "Recipient Wallet", - style: STextStyles.itemSubtitle.copyWith( - color: CFColors.neutral50, - ), + style: STextStyles.smallMed12, ), // GestureDetector( // onTap: () { @@ -199,7 +196,7 @@ class _Step2ViewState extends ConsumerState { focusNode: _toFocusNode, style: STextStyles.field, decoration: standardInputDecoration( - "Enter the ${model.receiveTicker} payout address", + "Enter the ${model.receiveTicker.toUpperCase()} payout address", _toFocusNode, ).copyWith( contentPadding: const EdgeInsets.only( @@ -336,7 +333,7 @@ class _Step2ViewState extends ConsumerState { ), RoundedWhiteContainer( child: Text( - "This is the wallet where your ${model.receiveTicker} will be sent to.", + "This is the wallet where your ${model.receiveTicker.toUpperCase()} will be sent to.", style: STextStyles.label, ), ), @@ -387,7 +384,7 @@ class _Step2ViewState extends ConsumerState { focusNode: _refundFocusNode, style: STextStyles.field, decoration: standardInputDecoration( - "Enter ${model.sendTicker} refund address", + "Enter ${model.sendTicker.toUpperCase()} refund address", _refundFocusNode, ).copyWith( contentPadding: const EdgeInsets.only( @@ -538,10 +535,13 @@ class _Step2ViewState extends ConsumerState { onPressed: () { Navigator.of(context).pop(); }, + style: StackTheme.instance + .getSecondaryEnabledButtonColor(context), child: Text( "Back", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, + color: StackTheme + .instance.color.buttonTextSecondary, ), ), ), @@ -559,15 +559,8 @@ class _Step2ViewState extends ConsumerState { Step3View.routeName, arguments: model); }, - style: Theme.of(context) - .textButtonTheme - .style - ?.copyWith( - backgroundColor: - MaterialStateProperty.all( - CFColors.stackAccent, - ), - ), + style: StackTheme.instance + .getPrimaryEnabledButtonColor(context), child: Text( "Next", style: STextStyles.button, diff --git a/lib/pages/exchange_view/exchange_step_views/step_3_view.dart b/lib/pages/exchange_view/exchange_step_views/step_3_view.dart index bd84c5871..a8116dd42 100644 --- a/lib/pages/exchange_view/exchange_step_views/step_3_view.dart +++ b/lib/pages/exchange_view/exchange_step_views/step_3_view.dart @@ -12,10 +12,9 @@ import 'package:stackwallet/providers/exchange/change_now_provider.dart'; import 'package:stackwallet/providers/global/trades_service_provider.dart'; import 'package:stackwallet/services/notifications_api.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:stackwallet/widgets/stack_dialog.dart'; @@ -109,7 +108,7 @@ class _Step3ViewState extends ConsumerState { ), const Spacer(), Text( - "${model.sendAmount.toString()} ${model.sendTicker}", + "${model.sendAmount.toString()} ${model.sendTicker.toUpperCase()}", style: STextStyles.itemSubtitle12, ) ], @@ -127,7 +126,7 @@ class _Step3ViewState extends ConsumerState { ), const Spacer(), Text( - "${model.receiveAmount.toString()} ${model.receiveTicker}", + "${model.receiveAmount.toString()} ${model.receiveTicker.toUpperCase()}", style: STextStyles.itemSubtitle12, ) ], @@ -159,7 +158,7 @@ class _Step3ViewState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Recipient ${model.receiveTicker} address", + "Recipient ${model.receiveTicker.toUpperCase()} address", style: STextStyles.itemSubtitle, ), const SizedBox( @@ -180,7 +179,7 @@ class _Step3ViewState extends ConsumerState { crossAxisAlignment: CrossAxisAlignment.start, children: [ Text( - "Refund ${model.sendTicker} address", + "Refund ${model.sendTicker.toUpperCase()} address", style: STextStyles.itemSubtitle, ), const SizedBox( @@ -204,10 +203,13 @@ class _Step3ViewState extends ConsumerState { onPressed: () { Navigator.of(context).pop(); }, + style: StackTheme.instance + .getSecondaryEnabledButtonColor(context), child: Text( "Back", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, + color: StackTheme + .instance.color.buttonTextSecondary, ), ), ), @@ -304,15 +306,8 @@ class _Step3ViewState extends ConsumerState { )); } }, - style: Theme.of(context) - .textButtonTheme - .style - ?.copyWith( - backgroundColor: - MaterialStateProperty.all( - CFColors.stackAccent, - ), - ), + style: StackTheme.instance + .getPrimaryEnabledButtonColor(context), child: Text( "Next", style: STextStyles.button, diff --git a/lib/pages/exchange_view/exchange_step_views/step_4_view.dart b/lib/pages/exchange_view/exchange_step_views/step_4_view.dart index 544f6c40f..b94f29cbe 100644 --- a/lib/pages/exchange_view/exchange_step_views/step_4_view.dart +++ b/lib/pages/exchange_view/exchange_step_views/step_4_view.dart @@ -18,7 +18,6 @@ import 'package:stackwallet/providers/exchange/exchange_send_from_wallet_id_prov import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart'; @@ -158,27 +157,27 @@ class _Step4ViewState extends ConsumerState { height: 14, ), Text( - "Send ${model.sendTicker} to the address below", + "Send ${model.sendTicker.toUpperCase()} to the address below", style: STextStyles.pageTitleH1, ), const SizedBox( height: 8, ), Text( - "Send ${model.sendTicker} to the address below. Once it is received, ChangeNOW will send the ${model.receiveTicker} to the recipient address you provided. You can find this trade details and check its status in the list of trades.", + "Send ${model.sendTicker.toUpperCase()} to the address below. Once it is received, ChangeNOW will send the ${model.receiveTicker.toUpperCase()} to the recipient address you provided. You can find this trade details and check its status in the list of trades.", style: STextStyles.itemSubtitle, ), const SizedBox( height: 12, ), RoundedContainer( - color: CFColors.warningBackground, + color: StackTheme.instance.color.warningBackground, child: RichText( text: TextSpan( text: "You must send at least ${model.sendAmount.toString()} ${model.sendTicker}. ", style: STextStyles.label.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.textDark, fontWeight: FontWeight.w700, ), children: [ @@ -186,7 +185,7 @@ class _Step4ViewState extends ConsumerState { text: "If you send less than ${model.sendAmount.toString()} ${model.sendTicker}, your transaction may not be converted and it may not be refunded.", style: STextStyles.label.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.textDark, fontWeight: FontWeight.w500, ), ), @@ -207,9 +206,7 @@ class _Step4ViewState extends ConsumerState { children: [ Text( "Amount", - style: STextStyles.itemSubtitle.copyWith( - color: CFColors.neutral50, - ), + style: STextStyles.itemSubtitle, ), GestureDetector( onTap: () async { @@ -246,7 +243,7 @@ class _Step4ViewState extends ConsumerState { height: 4, ), Text( - "${model.sendAmount.toString()} ${model.sendTicker}", + "${model.sendAmount.toString()} ${model.sendTicker.toUpperCase()}", style: STextStyles.itemSubtitle12, ), ], @@ -264,10 +261,8 @@ class _Step4ViewState extends ConsumerState { MainAxisAlignment.spaceBetween, children: [ Text( - "Send ${model.sendTicker} to this address", - style: STextStyles.itemSubtitle.copyWith( - color: CFColors.neutral50, - ), + "Send ${model.sendTicker.toUpperCase()} to this address", + style: STextStyles.itemSubtitle, ), GestureDetector( onTap: () async { @@ -362,14 +357,13 @@ class _Step4ViewState extends ConsumerState { children: [ Text( "Status", - style: STextStyles.itemSubtitle.copyWith( - color: CFColors.neutral50, - ), + style: STextStyles.itemSubtitle, ), Text( _statusString, style: STextStyles.itemSubtitle.copyWith( - color: CFColors.status.forStatus(_status), + color: StackTheme.instance + .colorForStatus(_status), ), ), ], @@ -409,7 +403,8 @@ class _Step4ViewState extends ConsumerState { .size .width / 2, - foregroundColor: CFColors.stackAccent, + foregroundColor: StackTheme + .instance.color.accentColorDark, ), ), const SizedBox( @@ -422,11 +417,17 @@ class _Step4ViewState extends ConsumerState { child: TextButton( onPressed: () => Navigator.of(context).pop(), + style: StackTheme.instance + .getSecondaryEnabledButtonColor( + context), child: Text( "Cancel", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, + color: StackTheme + .instance + .color + .buttonTextSecondary, ), ), ), @@ -439,13 +440,8 @@ class _Step4ViewState extends ConsumerState { }, ); }, - style: - Theme.of(context).textButtonTheme.style?.copyWith( - backgroundColor: - MaterialStateProperty.all( - CFColors.stackAccent, - ), - ), + style: StackTheme.instance + .getPrimaryEnabledButtonColor(context), child: Text( "Show QR Code", style: STextStyles.button, @@ -573,8 +569,10 @@ class _Step4ViewState extends ConsumerState { "Ok", style: STextStyles.button .copyWith( - color: - CFColors.stackAccent, + color: StackTheme + .instance + .color + .buttonTextSecondary, ), ), onPressed: () { @@ -611,10 +609,13 @@ class _Step4ViewState extends ConsumerState { ), ); }, + style: StackTheme.instance + .getSecondaryEnabledButtonColor(context), child: Text( buttonTitle, style: STextStyles.button.copyWith( - color: CFColors.stackAccent, + color: StackTheme + .instance.color.buttonTextSecondary, ), ), ); diff --git a/lib/pages/exchange_view/exchange_view.dart b/lib/pages/exchange_view/exchange_view.dart index db9c014a5..09d552ad2 100644 --- a/lib/pages/exchange_view/exchange_view.dart +++ b/lib/pages/exchange_view/exchange_view.dart @@ -29,7 +29,6 @@ import 'package:stackwallet/providers/exchange/trade_sent_from_stack_lookup_prov import 'package:stackwallet/providers/global/trades_service_provider.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -67,7 +66,7 @@ class _ExchangeViewState extends ConsumerState { builder: (_) => WillPopScope( onWillPop: () async => false, child: Container( - color: CFColors.stackAccent.withOpacity(0.8), + color: StackTheme.instance.color.overlay.withOpacity(0.8), child: const CustomLoadingOverlay( message: "Updating exchange rate", eventBus: null, @@ -368,7 +367,7 @@ class _ExchangeViewState extends ConsumerState { Text( "You will send", style: STextStyles.itemSubtitle.copyWith( - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, ), ), const SizedBox( @@ -562,7 +561,10 @@ class _ExchangeViewState extends ConsumerState { width: 18, height: 18, decoration: BoxDecoration( - color: CFColors.gray3, + color: StackTheme + .instance + .color + .textFieldDefaultBG, borderRadius: BorderRadius.circular( 18, @@ -584,7 +586,7 @@ class _ExchangeViewState extends ConsumerState { width: 18, height: 18, decoration: BoxDecoration( - // color: CFColors.stackAccent, + // color: StackTheme.instance.color.accentColorDark borderRadius: BorderRadius.circular(18), ), @@ -592,7 +594,8 @@ class _ExchangeViewState extends ConsumerState { Assets.svg.circleQuestion, width: 18, height: 18, - color: CFColors.gray3, + color: StackTheme.instance + .color.textFieldDefaultBG, ), ); } @@ -617,7 +620,8 @@ class _ExchangeViewState extends ConsumerState { .toUpperCase())) ?? "-", style: STextStyles.smallMed14.copyWith( - color: CFColors.stackAccent, + color: StackTheme + .instance.color.textDark, ), ), const SizedBox( @@ -627,7 +631,8 @@ class _ExchangeViewState extends ConsumerState { Assets.svg.chevronDown, width: 5, height: 2.5, - color: CFColors.stackAccent, + color: + StackTheme.instance.color.textDark, ), ], ), @@ -648,7 +653,7 @@ class _ExchangeViewState extends ConsumerState { child: Text( "You will receive", style: STextStyles.itemSubtitle.copyWith( - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, ), ), ), @@ -664,6 +669,8 @@ class _ExchangeViewState extends ConsumerState { Assets.svg.swap, width: 20, height: 20, + color: + StackTheme.instance.color.accentColorDark, ), ), ), @@ -875,7 +882,10 @@ class _ExchangeViewState extends ConsumerState { width: 18, height: 18, decoration: BoxDecoration( - color: CFColors.gray3, + color: StackTheme + .instance + .color + .textFieldDefaultBG, borderRadius: BorderRadius.circular( 18), @@ -896,7 +906,7 @@ class _ExchangeViewState extends ConsumerState { width: 18, height: 18, decoration: BoxDecoration( - // color: CFColors.stackAccent, + // color: StackTheme.instance.color.accentColorDark borderRadius: BorderRadius.circular(18), ), @@ -904,7 +914,8 @@ class _ExchangeViewState extends ConsumerState { Assets.svg.circleQuestion, width: 18, height: 18, - color: CFColors.gray3, + color: StackTheme.instance + .color.textFieldDefaultBG, ), ); } @@ -929,7 +940,8 @@ class _ExchangeViewState extends ConsumerState { .toUpperCase())) ?? "-", style: STextStyles.smallMed14.copyWith( - color: CFColors.stackAccent, + color: StackTheme + .instance.color.textDark, ), ), const SizedBox( @@ -939,7 +951,8 @@ class _ExchangeViewState extends ConsumerState { Assets.svg.chevronDown, width: 5, height: 2.5, - color: CFColors.stackAccent, + color: + StackTheme.instance.color.textDark, ), ], ), @@ -1118,29 +1131,18 @@ class _ExchangeViewState extends ConsumerState { height: 12, ), TextButton( - style: Theme.of(context) - .textButtonTheme - .style - ?.copyWith( - backgroundColor: MaterialStateProperty.all( - ((ref - .read( - prefsChangeNotifierProvider) - .exchangeRateType == - ExchangeRateType.estimated) - ? ref.watch( - estimatedRateExchangeFormProvider - .select((value) => - value.canExchange)) - : ref.watch( - fixedRateExchangeFormProvider - .select((value) => - value.canExchange))) - ? CFColors.stackAccent - : StackTheme - .instance.color.buttonBackSecondary, - ), - ), + style: ((ref + .read(prefsChangeNotifierProvider) + .exchangeRateType == + ExchangeRateType.estimated) + ? ref.watch(estimatedRateExchangeFormProvider + .select((value) => value.canExchange)) + : ref.watch(fixedRateExchangeFormProvider + .select((value) => value.canExchange))) + ? StackTheme.instance + .getPrimaryEnabledButtonColor(context) + : StackTheme.instance + .getPrimaryDisabledButtonColor(context), onPressed: ((ref .read(prefsChangeNotifierProvider) .exchangeRateType == @@ -1318,16 +1320,9 @@ class _ExchangeViewState extends ConsumerState { }, ), rightButton: TextButton( - style: Theme.of(context) - .textButtonTheme - .style - ?.copyWith( - backgroundColor: - MaterialStateProperty.all< - Color>( - CFColors.stackAccent, - ), - ), + style: StackTheme.instance + .getPrimaryEnabledButtonColor( + context), child: Text( "Attempt", style: STextStyles.button, @@ -1346,7 +1341,7 @@ class _ExchangeViewState extends ConsumerState { } String rate = - "1 $fromTicker ~${ref.read(fixedRateExchangeFormProvider).rate!.toStringAsFixed(8)} $toTicker"; + "1 ${fromTicker.toUpperCase()} ~${ref.read(fixedRateExchangeFormProvider).rate!.toStringAsFixed(8)} ${toTicker.toUpperCase()}"; final model = IncompleteExchangeModel( sendTicker: fromTicker, @@ -1383,7 +1378,7 @@ class _ExchangeViewState extends ConsumerState { // Text( // "Trades", // style: STextStyles.itemSubtitle.copyWith( - // color: CFColors.neutral50, + // color: StackTheme.instance.color.textDark3, // ), // ), // SizedBox( @@ -1423,7 +1418,7 @@ class _ExchangeViewState extends ConsumerState { Text( "Trades", style: STextStyles.itemSubtitle.copyWith( - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, ), ), const SizedBox( @@ -1495,7 +1490,7 @@ class _ExchangeViewState extends ConsumerState { padding: const EdgeInsets.symmetric(horizontal: 4), child: Container( decoration: BoxDecoration( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -1537,7 +1532,7 @@ class RateInfo extends ConsumerWidget { return Container( decoration: BoxDecoration( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -1625,7 +1620,7 @@ class RateInfo extends ConsumerWidget { Assets.svg.chevronDown, width: 5, height: 2.5, - color: CFColors.neutral60, + color: StackTheme.instance.color.infoItemLabel, ), ], ), diff --git a/lib/pages/exchange_view/send_from_view.dart b/lib/pages/exchange_view/send_from_view.dart index fbab2953b..9bc42e174 100644 --- a/lib/pages/exchange_view/send_from_view.dart +++ b/lib/pages/exchange_view/send_from_view.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; @@ -9,7 +11,6 @@ import 'package:stackwallet/pages/send_view/sub_widgets/building_transaction_dia import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart'; @@ -160,7 +161,7 @@ class _SendFromCardState extends ConsumerState { return RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: MaterialButton( - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, key: Key("walletsSheetItemButtonKey_$walletId"), padding: const EdgeInsets.all(5), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, @@ -175,7 +176,7 @@ class _SendFromCardState extends ConsumerState { try { bool wasCancelled = false; - showDialog( + unawaited(showDialog( context: context, useSafeArea: false, barrierDismissible: false, @@ -188,7 +189,7 @@ class _SendFromCardState extends ConsumerState { }, ); }, - ); + )); final txData = await manager.prepareSend( address: address, @@ -211,7 +212,7 @@ class _SendFromCardState extends ConsumerState { txData["address"] = address; if (mounted) { - Navigator.of(context).push( + await Navigator.of(context).push( RouteGenerator.getRoute( shouldUseMaterialRoute: RouteGenerator.useMaterialPageRoute, builder: (_) => ConfirmChangeNowSendView( @@ -232,7 +233,7 @@ class _SendFromCardState extends ConsumerState { // pop building dialog Navigator.of(context).pop(); - showDialog( + await showDialog( context: context, useSafeArea: false, barrierDismissible: true, @@ -246,7 +247,7 @@ class _SendFromCardState extends ConsumerState { child: Text( "Ok", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.buttonTextSecondary, ), ), onPressed: () { @@ -263,7 +264,9 @@ class _SendFromCardState extends ConsumerState { children: [ Container( decoration: BoxDecoration( - color: CFColors.coin.forCoin(manager.coin).withOpacity(0.5), + color: StackTheme.instance + .colorForCoin(manager.coin) + .withOpacity(0.5), borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), diff --git a/lib/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart b/lib/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart index 500dd9df7..9926b2eab 100644 --- a/lib/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart +++ b/lib/pages/exchange_view/sub_widgets/exchange_rate_sheet.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; @@ -16,9 +15,9 @@ class ExchangeRateSheet extends ConsumerWidget { @override Widget build(BuildContext context, WidgetRef ref) { return Container( - decoration: const BoxDecoration( - color: CFColors.white, - borderRadius: BorderRadius.vertical( + decoration: BoxDecoration( + color: StackTheme.instance.color.popupBG, + borderRadius: const BorderRadius.vertical( top: Radius.circular(20), ), ), @@ -36,7 +35,7 @@ class ExchangeRateSheet extends ConsumerWidget { Center( child: Container( decoration: BoxDecoration( - color: StackTheme.instance.color.textFieldDefaultBG, + color: StackTheme.instance.color.textSubtitle4, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -104,9 +103,7 @@ class ExchangeRateSheet extends ConsumerWidget { children: [ Text( "Estimated rate", - style: STextStyles.titleBold12.copyWith( - color: const Color(0xFF44464E), - ), + style: STextStyles.titleBold12, textAlign: TextAlign.left, ), const SizedBox( @@ -114,7 +111,9 @@ class ExchangeRateSheet extends ConsumerWidget { ), Text( "ChangeNOW will pick the best rate for you during the moment of the exchange.", - style: STextStyles.itemSubtitle, + style: STextStyles.itemSubtitle.copyWith( + color: StackTheme.instance.color.textSubtitle1, + ), textAlign: TextAlign.left, ), ], @@ -172,9 +171,7 @@ class ExchangeRateSheet extends ConsumerWidget { children: [ Text( "Fixed rate", - style: STextStyles.titleBold12.copyWith( - color: const Color(0xFF44464E), - ), + style: STextStyles.titleBold12, textAlign: TextAlign.left, ), const SizedBox( @@ -182,7 +179,9 @@ class ExchangeRateSheet extends ConsumerWidget { ), Text( "You will get the exact exchange amount displayed - ChangeNOW takes all the rate risks.", - style: STextStyles.itemSubtitle, + style: STextStyles.itemSubtitle.copyWith( + color: StackTheme.instance.color.textSubtitle1, + ), textAlign: TextAlign.left, ) ], diff --git a/lib/pages/exchange_view/sub_widgets/step_indicator.dart b/lib/pages/exchange_view/sub_widgets/step_indicator.dart index 2582374ad..9e8cd4dca 100644 --- a/lib/pages/exchange_view/sub_widgets/step_indicator.dart +++ b/lib/pages/exchange_view/sub_widgets/step_indicator.dart @@ -2,7 +2,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_svg/svg.dart'; import 'package:google_fonts/google_fonts.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; enum StepIndicatorStatus { current, completed, incomplete } @@ -23,11 +22,11 @@ class StepIndicator extends StatelessWidget { Color get background { switch (status) { case StepIndicatorStatus.current: - return CFColors.selection; + return StackTheme.instance.color.stepIndicatorBGNumber; case StepIndicatorStatus.completed: - return CFColors.selection; + return StackTheme.instance.color.stepIndicatorBGCheck; case StepIndicatorStatus.incomplete: - return CFColors.stackAccent.withOpacity(0.2); + return StackTheme.instance.color.stepIndicatorBGInactive; } } diff --git a/lib/pages/exchange_view/sub_widgets/step_row.dart b/lib/pages/exchange_view/sub_widgets/step_row.dart index 0696b94fe..9d2b09451 100644 --- a/lib/pages/exchange_view/sub_widgets/step_row.dart +++ b/lib/pages/exchange_view/sub_widgets/step_row.dart @@ -1,6 +1,5 @@ import 'package:flutter/cupertino.dart'; import 'package:stackwallet/pages/exchange_view/sub_widgets/step_indicator.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; class StepRow extends StatelessWidget { @@ -21,7 +20,7 @@ class StepRow extends StatelessWidget { Color getColor(int index) { if (current >= count - 1) { - return CFColors.stackAccent; + return StackTheme.instance.color.accentColorDark; } if (current <= index) { diff --git a/lib/pages/exchange_view/trade_details_view.dart b/lib/pages/exchange_view/trade_details_view.dart index 150bb719d..2f293b95e 100644 --- a/lib/pages/exchange_view/trade_details_view.dart +++ b/lib/pages/exchange_view/trade_details_view.dart @@ -17,7 +17,6 @@ import 'package:stackwallet/providers/exchange/trade_note_service_provider.dart' import 'package:stackwallet/providers/global/trades_service_provider.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; @@ -222,9 +221,9 @@ class _TradeDetailsViewState extends ConsumerState { trade.statusObject?.status.name ?? trade.statusString, style: STextStyles.itemSubtitle.copyWith( color: trade.statusObject != null - ? CFColors.status - .forStatus(trade.statusObject!.status) - : CFColors.stackAccent, + ? StackTheme.instance + .colorForStatus(trade.statusObject!.status) + : StackTheme.instance.color.accentColorDark, ), ), // ), @@ -238,7 +237,7 @@ class _TradeDetailsViewState extends ConsumerState { ), if (!sentFromStack && !hasTx) RoundedContainer( - color: CFColors.warningBackground, + color: StackTheme.instance.color.warningBackground, child: RichText( text: TextSpan( text: @@ -246,7 +245,7 @@ class _TradeDetailsViewState extends ConsumerState { trade.fromCurrency.toLowerCase() == "xmr" ? 12 : 8, )} ${trade.fromCurrency.toUpperCase()}. ", style: STextStyles.label.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, fontWeight: FontWeight.w700, ), children: [ @@ -258,7 +257,8 @@ class _TradeDetailsViewState extends ConsumerState { : 8, )} ${trade.fromCurrency.toUpperCase()}, your transaction may not be converted and it may not be refunded.", style: STextStyles.label.copyWith( - color: CFColors.stackAccent, + color: + StackTheme.instance.color.accentColorDark, fontWeight: FontWeight.w500, ), ), @@ -383,12 +383,14 @@ class _TradeDetailsViewState extends ConsumerState { width: width + 20, height: width + 20, child: QrImage( - data: trade.payinAddress, - size: width, - backgroundColor: CFColors.white, - foregroundColor: - CFColors.stackAccent, - ), + data: trade.payinAddress, + size: width, + backgroundColor: StackTheme + .instance.color.popupBG, + foregroundColor: StackTheme + .instance + .color + .accentColorDark), ), ), ), @@ -408,10 +410,12 @@ class _TradeDetailsViewState extends ConsumerState { context), child: Text( "Cancel", - style: - STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + style: STextStyles.button + .copyWith( + color: StackTheme + .instance + .color + .accentColorDark), ), ), ), diff --git a/lib/pages/exchange_view/wallet_initiated_exchange_view.dart b/lib/pages/exchange_view/wallet_initiated_exchange_view.dart index 31eb748b4..0a78e9397 100644 --- a/lib/pages/exchange_view/wallet_initiated_exchange_view.dart +++ b/lib/pages/exchange_view/wallet_initiated_exchange_view.dart @@ -26,7 +26,6 @@ import 'package:stackwallet/providers/exchange/fixed_rate_exchange_form_provider import 'package:stackwallet/providers/exchange/fixed_rate_market_pairs_provider.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -82,7 +81,7 @@ class _WalletInitiatedExchangeViewState builder: (_) => WillPopScope( onWillPop: () async => false, child: Container( - color: CFColors.stackAccent.withOpacity(0.8), + color: StackTheme.instance.color.accentColorDark.withOpacity(0.8), child: const CustomLoadingOverlay( message: "Updating exchange rate", eventBus: null, @@ -413,7 +412,7 @@ class _WalletInitiatedExchangeViewState Text( "You will send", style: STextStyles.itemSubtitle.copyWith( - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, ), ), const SizedBox( @@ -622,7 +621,10 @@ class _WalletInitiatedExchangeViewState width: 18, height: 18, decoration: BoxDecoration( - color: CFColors.gray3, + color: StackTheme + .instance + .color + .textSubtitle2, borderRadius: BorderRadius .circular( @@ -646,7 +648,7 @@ class _WalletInitiatedExchangeViewState width: 18, height: 18, decoration: BoxDecoration( - // color: CFColors.stackAccent, + // color: StackTheme.instance.color.accentColorDark borderRadius: BorderRadius.circular( 18), @@ -655,7 +657,8 @@ class _WalletInitiatedExchangeViewState Assets.svg.circleQuestion, width: 18, height: 18, - color: CFColors.gray3, + color: StackTheme.instance + .color.textSubtitle2, ), ); } @@ -679,10 +682,10 @@ class _WalletInitiatedExchangeViewState .market?.from .toUpperCase())) ?? "-", - style: - STextStyles.smallMed14.copyWith( - color: CFColors.stackAccent, - ), + style: STextStyles.smallMed14 + .copyWith( + color: StackTheme.instance + .color.accentColorDark), ), const SizedBox( width: 6, @@ -706,11 +709,11 @@ class _WalletInitiatedExchangeViewState return Container(); } return SvgPicture.asset( - Assets.svg.chevronDown, - width: 5, - height: 2.5, - color: CFColors.stackAccent, - ); + Assets.svg.chevronDown, + width: 5, + height: 2.5, + color: StackTheme.instance.color + .accentColorDark); }), ], ), @@ -731,7 +734,7 @@ class _WalletInitiatedExchangeViewState child: Text( "You will receive", style: STextStyles.itemSubtitle.copyWith( - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, ), ), ), @@ -981,7 +984,10 @@ class _WalletInitiatedExchangeViewState width: 18, height: 18, decoration: BoxDecoration( - color: CFColors.gray3, + color: StackTheme + .instance + .color + .textSubtitle2, borderRadius: BorderRadius .circular(18), @@ -1003,7 +1009,7 @@ class _WalletInitiatedExchangeViewState width: 18, height: 18, decoration: BoxDecoration( - // color: CFColors.stackAccent, + // color: StackTheme.instance.color.accentColorDark borderRadius: BorderRadius.circular( 18), @@ -1012,7 +1018,8 @@ class _WalletInitiatedExchangeViewState Assets.svg.circleQuestion, width: 18, height: 18, - color: CFColors.gray3, + color: StackTheme.instance + .color.textSubtitle2, ), ); } @@ -1036,10 +1043,10 @@ class _WalletInitiatedExchangeViewState .market?.to .toUpperCase())) ?? "-", - style: - STextStyles.smallMed14.copyWith( - color: CFColors.stackAccent, - ), + style: STextStyles.smallMed14 + .copyWith( + color: StackTheme.instance + .color.accentColorDark), ), const SizedBox( width: 6, @@ -1063,11 +1070,11 @@ class _WalletInitiatedExchangeViewState return Container(); } return SvgPicture.asset( - Assets.svg.chevronDown, - width: 5, - height: 2.5, - color: CFColors.stackAccent, - ); + Assets.svg.chevronDown, + width: 5, + height: 2.5, + color: StackTheme.instance.color + .accentColorDark); }), ], ), @@ -1216,28 +1223,18 @@ class _WalletInitiatedExchangeViewState ), const Spacer(), TextButton( - style: - Theme.of(context).textButtonTheme.style?.copyWith( - backgroundColor: - MaterialStateProperty.all( - ((ref - .read( - prefsChangeNotifierProvider) - .exchangeRateType == - ExchangeRateType.estimated) - ? ref.watch( - estimatedRateExchangeFormProvider - .select((value) => - value.canExchange)) - : ref.watch( - fixedRateExchangeFormProvider - .select((value) => - value.canExchange))) - ? CFColors.stackAccent - : StackTheme.instance.color - .buttonBackSecondary, - ), - ), + style: ((ref + .read(prefsChangeNotifierProvider) + .exchangeRateType == + ExchangeRateType.estimated) + ? ref.watch(estimatedRateExchangeFormProvider + .select((value) => value.canExchange)) + : ref.watch(fixedRateExchangeFormProvider + .select((value) => value.canExchange))) + ? StackTheme.instance + .getPrimaryEnabledButtonColor(context) + : StackTheme.instance + .getSecondaryEnabledButtonColor(context), onPressed: ((ref .read(prefsChangeNotifierProvider) .exchangeRateType == @@ -1491,10 +1488,11 @@ class _WalletInitiatedExchangeViewState .style ?.copyWith( backgroundColor: - MaterialStateProperty.all< - Color>( - CFColors.stackAccent, - ), + MaterialStateProperty + .all(StackTheme + .instance + .color + .accentColorDark), ), child: Text( "Attempt", diff --git a/lib/pages/home_view/home_view.dart b/lib/pages/home_view/home_view.dart index 665de4277..d4a97b2b0 100644 --- a/lib/pages/home_view/home_view.dart +++ b/lib/pages/home_view/home_view.dart @@ -144,7 +144,7 @@ class _HomeViewState extends ConsumerState { onTap: _hiddenOptions, child: SvgPicture.asset( Assets.svg.stackIcon, - // color: CFColors.stackAccent, + // color: StackTheme.instance.color.accentColorDark width: 24, height: 24, ), diff --git a/lib/pages/home_view/sub_widgets/home_view_button_bar.dart b/lib/pages/home_view/sub_widgets/home_view_button_bar.dart index 369b37375..967c23236 100644 --- a/lib/pages/home_view/sub_widgets/home_view_button_bar.dart +++ b/lib/pages/home_view/sub_widgets/home_view_button_bar.dart @@ -261,7 +261,7 @@ class _HomeViewButtonBarState extends ConsumerState { // style: STextStyles.button.copyWith( // fontSize: 14, // color: - // selectedIndex == 2 ? CFColors.light1 : CFColors.stackAccent, + // selectedIndex == 2 ? CFColors.light1 : StackTheme.instance.color.accentColorDark // ), // ), // ), diff --git a/lib/pages/manage_favorites_view/manage_favorites_view.dart b/lib/pages/manage_favorites_view/manage_favorites_view.dart index de390fc32..a8027f05c 100644 --- a/lib/pages/manage_favorites_view/manage_favorites_view.dart +++ b/lib/pages/manage_favorites_view/manage_favorites_view.dart @@ -1,11 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/services/coins/manager.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/managed_favorite.dart'; @@ -44,7 +42,7 @@ class ManageFavoritesView extends StatelessWidget { padding: const EdgeInsets.symmetric(horizontal: 4), child: Container( decoration: BoxDecoration( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -69,10 +67,7 @@ class ManageFavoritesView extends StatelessWidget { key: key, itemCount: favorites.length, itemBuilder: (builderContext, index) { - final walletId = ref - .read(favorites[index] - as ChangeNotifierProvider) - .walletId; + final walletId = ref.read(favorites[index]).walletId; return Padding( key: Key( "manageFavoriteWalletsItem_$walletId", @@ -122,7 +117,7 @@ class ManageFavoritesView extends StatelessWidget { child: Text( "Add to favorites", style: STextStyles.itemSubtitle12.copyWith( - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, ), ), ), @@ -136,10 +131,7 @@ class ManageFavoritesView extends StatelessWidget { itemBuilder: (buildContext, index) { // final walletId = ref.watch( // nonFavorites[index].select((value) => value.walletId)); - final walletId = ref - .read(nonFavorites[index] - as ChangeNotifierProvider) - .walletId; + final walletId = ref.read(nonFavorites[index]).walletId; return Padding( key: Key( "manageNonFavoriteWalletsItem_$walletId", diff --git a/lib/pages/pinpad_views/lock_screen_view.dart b/lib/pages/pinpad_views/lock_screen_view.dart index f9c14b465..9854d1e4e 100644 --- a/lib/pages/pinpad_views/lock_screen_view.dart +++ b/lib/pages/pinpad_views/lock_screen_view.dart @@ -12,7 +12,6 @@ import 'package:stackwallet/providers/global/wallets_provider.dart'; // import 'package:stackwallet/providers/global/should_show_lockscreen_on_resume_state_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/biometrics.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; @@ -152,8 +151,9 @@ class _LockscreenViewState extends ConsumerState { BoxDecoration get _pinPutDecoration { return BoxDecoration( - color: CFColors.gray3, - border: Border.all(width: 1, color: CFColors.gray3), + color: StackTheme.instance.color.textSubtitle2, + border: + Border.all(width: 1, color: StackTheme.instance.color.textSubtitle2), borderRadius: BorderRadius.circular(6), ); } diff --git a/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart b/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart index b7707e23f..c91506c68 100644 --- a/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart +++ b/lib/pages/receive_view/generate_receiving_uri_qr_code_view.dart @@ -12,7 +12,6 @@ import 'package:qr_flutter/qr_flutter.dart'; import 'package:share_plus/share_plus.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -245,13 +244,8 @@ class _GenerateUriQrCodeViewState extends State { height: 8, ), TextButton( - style: - Theme.of(context).textButtonTheme.style?.copyWith( - backgroundColor: - MaterialStateProperty.all( - CFColors.stackAccent, - ), - ), + style: StackTheme.instance + .getPrimaryEnabledButtonColor(context), onPressed: () { final amountString = amountController.text; final noteString = noteController.text; @@ -319,12 +313,14 @@ class _GenerateUriQrCodeViewState extends State { width: width + 20, height: width + 20, child: QrImage( - data: uriString, - size: width, - backgroundColor: CFColors.white, - foregroundColor: - CFColors.stackAccent, - ), + data: uriString, + size: width, + backgroundColor: StackTheme + .instance.color.popupBG, + foregroundColor: StackTheme + .instance + .color + .accentColorDark), ), ), ), @@ -364,11 +360,7 @@ class _GenerateUriQrCodeViewState extends State { "Share", textAlign: TextAlign.center, - style: STextStyles.button - .copyWith( - color: CFColors - .stackAccent, - ), + style: STextStyles.button, ), const SizedBox( height: 2, diff --git a/lib/pages/receive_view/receive_view.dart b/lib/pages/receive_view/receive_view.dart index bcbd7d3c5..0c3993e19 100644 --- a/lib/pages/receive_view/receive_view.dart +++ b/lib/pages/receive_view/receive_view.dart @@ -10,7 +10,6 @@ import 'package:stackwallet/pages/receive_view/generate_receiving_uri_qr_code_vi import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; @@ -202,8 +201,7 @@ class _ReceiveViewState extends ConsumerState { child: Text( "Generate new address", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme.instance.color.accentColorDark), ), ), const SizedBox( @@ -216,10 +214,10 @@ class _ReceiveViewState extends ConsumerState { child: Column( children: [ QrImage( - data: "${coin.uriScheme}:$receivingAddress", - size: MediaQuery.of(context).size.width / 2, - foregroundColor: CFColors.stackAccent, - ), + data: "${coin.uriScheme}:$receivingAddress", + size: MediaQuery.of(context).size.width / 2, + foregroundColor: + StackTheme.instance.color.accentColorDark), const SizedBox( height: 20, ), diff --git a/lib/pages/send_view/confirm_transaction_view.dart b/lib/pages/send_view/confirm_transaction_view.dart index 7adddabb4..292b0fdd3 100644 --- a/lib/pages/send_view/confirm_transaction_view.dart +++ b/lib/pages/send_view/confirm_transaction_view.dart @@ -11,7 +11,6 @@ import 'package:stackwallet/providers/wallet/public_private_balance_state_provid import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/format.dart'; @@ -116,9 +115,8 @@ class _ConfirmTransactionViewState StackTheme.instance.getSecondaryEnabledButtonColor(context), child: Text( "Ok", - style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + style: STextStyles.button + .copyWith(color: StackTheme.instance.color.accentColorDark), ), onPressed: () { Navigator.of(context).pop(); @@ -315,13 +313,14 @@ class _ConfirmTransactionViewState height: 16, ), TextButton( - style: - Theme.of(context).textButtonTheme.style?.copyWith( - backgroundColor: - MaterialStateProperty.all( - CFColors.stackAccent, - ), - ), + style: Theme.of(context) + .textButtonTheme + .style + ?.copyWith( + backgroundColor: + MaterialStateProperty.all(StackTheme + .instance.color.accentColorDark), + ), onPressed: () async { final unlocked = await Navigator.push( context, diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index 2c5bd43c6..deb249037 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -20,7 +20,6 @@ import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/barcode_scanner_interface.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -401,7 +400,7 @@ class _SendViewState extends ConsumerState { children: [ Container( decoration: BoxDecoration( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -876,7 +875,8 @@ class _SendViewState extends ConsumerState { horizontal: 12, ), child: RawMaterialButton( - splashColor: CFColors.splashLight, + splashColor: + StackTheme.instance.color.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -977,7 +977,8 @@ class _SendViewState extends ConsumerState { Assets.svg.chevronDown, width: 8, height: 4, - color: CFColors.gray3, + color: StackTheme + .instance.color.textSubtitle2, ), ], ), @@ -1068,8 +1069,8 @@ class _SendViewState extends ConsumerState { child: Text( coin.ticker, style: STextStyles.smallMed14.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme + .instance.color.accentColorDark), ), ), ), @@ -1170,8 +1171,8 @@ class _SendViewState extends ConsumerState { ref.watch(prefsChangeNotifierProvider .select((value) => value.currency)), style: STextStyles.smallMed14.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme + .instance.color.accentColorDark), ), ), ), @@ -1246,7 +1247,8 @@ class _SendViewState extends ConsumerState { horizontal: 12, ), child: RawMaterialButton( - splashColor: CFColors.splashLight, + splashColor: + StackTheme.instance.color.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -1368,7 +1370,8 @@ class _SendViewState extends ConsumerState { Assets.svg.chevronDown, width: 8, height: 4, - color: CFColors.gray3, + color: StackTheme + .instance.color.textSubtitle2, ), ], ), @@ -1413,10 +1416,12 @@ class _SendViewState extends ConsumerState { context), child: Text( "Ok", - style: - STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + style: STextStyles.button + .copyWith( + color: StackTheme + .instance + .color + .accentColorDark), ), onPressed: () { Navigator.of(context).pop(); @@ -1475,10 +1480,12 @@ class _SendViewState extends ConsumerState { context), child: Text( "Cancel", - style: - STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + style: STextStyles.button + .copyWith( + color: StackTheme + .instance + .color + .accentColorDark), ), onPressed: () { Navigator.of(context).pop(false); @@ -1490,10 +1497,11 @@ class _SendViewState extends ConsumerState { .style ?.copyWith( backgroundColor: - MaterialStateProperty.all< - Color>( - CFColors.stackAccent, - ), + MaterialStateProperty + .all(StackTheme + .instance + .color + .accentColorDark), ), child: Text( "Yes", @@ -1604,10 +1612,12 @@ class _SendViewState extends ConsumerState { context), child: Text( "Ok", - style: - STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + style: STextStyles.button + .copyWith( + color: StackTheme + .instance + .color + .accentColorDark), ), onPressed: () { Navigator.of(context).pop(); @@ -1623,26 +1633,10 @@ class _SendViewState extends ConsumerState { style: ref .watch(previewTxButtonStateProvider.state) .state - ? Theme.of(context) - .textButtonTheme - .style - ?.copyWith( - backgroundColor: - MaterialStateProperty.all( - CFColors.stackAccent, - ), - ) - : Theme.of(context) - .textButtonTheme - .style - ?.copyWith( - backgroundColor: - MaterialStateProperty.all( - CFColors.stackAccent.withOpacity( - 0.25, - ), - ), - ), + ? StackTheme.instance + .getPrimaryEnabledButtonColor(context) + : StackTheme.instance + .getPrimaryDisabledButtonColor(context), child: Text( "Preview", style: STextStyles.button, diff --git a/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart b/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart index 9f2bbcb2b..783614f3a 100644 --- a/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart +++ b/lib/pages/send_view/sub_widgets/building_transaction_dialog.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/stack_dialog.dart'; @@ -63,7 +62,7 @@ class _RestoringDialogState extends State turns: _spinAnimation, child: SvgPicture.asset( Assets.svg.arrowRotate, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: 24, height: 24, ), diff --git a/lib/pages/send_view/sub_widgets/firo_balance_selection_sheet.dart b/lib/pages/send_view/sub_widgets/firo_balance_selection_sheet.dart index 8601b0709..badbbe9dd 100644 --- a/lib/pages/send_view/sub_widgets/firo_balance_selection_sheet.dart +++ b/lib/pages/send_view/sub_widgets/firo_balance_selection_sheet.dart @@ -4,7 +4,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/wallet/public_private_balance_state_provider.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -50,9 +49,9 @@ class _FiroBalanceSelectionSheetState final firoWallet = manager.wallet as FiroWallet; return Container( - decoration: const BoxDecoration( - color: CFColors.white, - borderRadius: BorderRadius.vertical( + decoration: BoxDecoration( + color: StackTheme.instance.color.popupBG, + borderRadius: const BorderRadius.vertical( top: Radius.circular(20), ), ), diff --git a/lib/pages/send_view/sub_widgets/sending_transaction_dialog.dart b/lib/pages/send_view/sub_widgets/sending_transaction_dialog.dart index 9bdc6d3bb..cd4044ae6 100644 --- a/lib/pages/send_view/sub_widgets/sending_transaction_dialog.dart +++ b/lib/pages/send_view/sub_widgets/sending_transaction_dialog.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/stack_dialog.dart'; @@ -56,7 +55,7 @@ class _RestoringDialogState extends State turns: _spinAnimation, child: SvgPicture.asset( Assets.svg.arrowRotate, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: 24, height: 24, ), diff --git a/lib/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart b/lib/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart index b56a5f37b..561910dd6 100644 --- a/lib/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart +++ b/lib/pages/send_view/sub_widgets/transaction_fee_selection_sheet.dart @@ -6,7 +6,6 @@ import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/ui/fee_rate_type_state_provider.dart'; import 'package:stackwallet/providers/wallet/public_private_balance_state_provider.dart'; import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/fee_rate_type_enum.dart'; @@ -163,9 +162,9 @@ class _TransactionFeeSelectionSheetState .select((value) => value.getManager(walletId))); return Container( - decoration: const BoxDecoration( - color: CFColors.white, - borderRadius: BorderRadius.vertical( + decoration: BoxDecoration( + color: StackTheme.instance.color.popupBG, + borderRadius: const BorderRadius.vertical( top: Radius.circular(20), ), ), diff --git a/lib/pages/settings_views/global_settings_view/advanced_views/advanced_settings_view.dart b/lib/pages/settings_views/global_settings_view/advanced_views/advanced_settings_view.dart index b51dd1358..c47f56de9 100644 --- a/lib/pages/settings_views/global_settings_view/advanced_views/advanced_settings_view.dart +++ b/lib/pages/settings_views/global_settings_view/advanced_views/advanced_settings_view.dart @@ -2,10 +2,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/advanced_views/debug_view.dart'; import 'package:stackwallet/providers/global/prefs_provider.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -42,7 +41,7 @@ class AdvancedSettingsView extends StatelessWidget { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( @@ -76,7 +75,7 @@ class AdvancedSettingsView extends StatelessWidget { child: Consumer( builder: (_, ref, __) { return RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( diff --git a/lib/pages/settings_views/global_settings_view/advanced_views/debug_view.dart b/lib/pages/settings_views/global_settings_view/advanced_views/debug_view.dart index fb7300675..e0b2e43ca 100644 --- a/lib/pages/settings_views/global_settings_view/advanced_views/debug_view.dart +++ b/lib/pages/settings_views/global_settings_view/advanced_views/debug_view.dart @@ -1,3 +1,4 @@ +import 'dart:async'; import 'dart:io'; import 'package:event_bus/event_bus.dart'; @@ -10,7 +11,6 @@ import 'package:stackwallet/models/isar/models/log.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/providers/global/debug_service_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/logger.dart'; @@ -117,12 +117,12 @@ class _DebugViewState extends ConsumerState { color: StackTheme.instance.color.background, icon: SvgPicture.asset( Assets.svg.trash, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: 20, height: 20, ), onPressed: () async { - showDialog( + await showDialog( context: context, builder: (_) => StackDialog( title: "Delete logs?", @@ -145,8 +145,7 @@ class _DebugViewState extends ConsumerState { .style ?.copyWith( backgroundColor: MaterialStateProperty.all( - CFColors.stackAccent, - ), + StackTheme.instance.color.accentColorDark), ), child: Text( "Delete logs", @@ -156,7 +155,7 @@ class _DebugViewState extends ConsumerState { Navigator.of(context).pop(); bool shouldPop = false; - showDialog( + unawaited(showDialog( barrierDismissible: false, context: context, builder: (_) => WillPopScope( @@ -164,11 +163,11 @@ class _DebugViewState extends ConsumerState { return shouldPop; }, child: const CustomLoadingOverlay( - message: "Generating Stack logs file", + message: "Deleting logs...", eventBus: null, ), ), - ); + )); await ref .read(debugServiceProvider) @@ -178,10 +177,10 @@ class _DebugViewState extends ConsumerState { if (mounted) { Navigator.pop(context); - showFloatingFlushBar( + unawaited(showFloatingFlushBar( type: FlushBarType.info, context: context, - message: 'Logs cleared!'); + message: 'Logs cleared!')); } }, ), @@ -312,7 +311,7 @@ class _DebugViewState extends ConsumerState { if (path != null) { final eventBus = EventBus(); bool shouldPop = false; - showDialog( + unawaited(showDialog( barrierDismissible: false, context: context, builder: (_) => WillPopScope( @@ -324,7 +323,7 @@ class _DebugViewState extends ConsumerState { eventBus: eventBus, ), ), - ); + )); await ref .read(debugServiceProvider) @@ -334,10 +333,10 @@ class _DebugViewState extends ConsumerState { if (mounted) { Navigator.pop(context); - showFloatingFlushBar( + unawaited(showFloatingFlushBar( type: FlushBarType.info, context: context, - message: 'Logs file saved'); + message: 'Logs file saved')); } } }, @@ -378,14 +377,14 @@ class _DebugViewState extends ConsumerState { return Container( key: Key("log_${log.id}_${log.timestampInMillisUTC}"), decoration: BoxDecoration( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, borderRadius: _borderRadius(index, logs.length), ), child: Padding( padding: const EdgeInsets.all(4), child: RoundedContainer( padding: const EdgeInsets.all(0), - color: CFColors.white, + color: StackTheme.instance.color.popupBG, child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ @@ -415,7 +414,8 @@ class _DebugViewState extends ConsumerState { "[${DateTime.fromMillisecondsSinceEpoch(log.timestampInMillisUTC, isUtc: true)}]: ", style: STextStyles.baseXS.copyWith( fontSize: 8, - color: CFColors.neutral50, + color: StackTheme + .instance.color.textDark3, ), ), ], diff --git a/lib/pages/settings_views/global_settings_view/appearance_settings_view.dart b/lib/pages/settings_views/global_settings_view/appearance_settings_view.dart index f00a2171e..8b1c95da8 100644 --- a/lib/pages/settings_views/global_settings_view/appearance_settings_view.dart +++ b/lib/pages/settings_views/global_settings_view/appearance_settings_view.dart @@ -1,10 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -46,7 +45,7 @@ class AppearanceSettingsView extends ConsumerWidget { child: Consumer( builder: (_, ref, __) { return RawMaterialButton( - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( diff --git a/lib/pages/settings_views/global_settings_view/currency_view.dart b/lib/pages/settings_views/global_settings_view/currency_view.dart index 969e0ecef..b5f620ef4 100644 --- a/lib/pages/settings_views/global_settings_view/currency_view.dart +++ b/lib/pages/settings_views/global_settings_view/currency_view.dart @@ -4,7 +4,6 @@ import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/providers/global/base_currencies_provider.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; @@ -204,7 +203,7 @@ class _CurrencyViewState extends ConsumerState { (context, index) { return Container( decoration: BoxDecoration( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, borderRadius: _borderRadius(index), ), child: Padding( @@ -214,8 +213,8 @@ class _CurrencyViewState extends ConsumerState { child: RoundedContainer( padding: const EdgeInsets.all(0), color: currenciesWithoutSelected[index] == current - ? CFColors.selected - : CFColors.white, + ? StackTheme.instance.color.currencyListItemBG + : StackTheme.instance.color.popupBG, child: RawMaterialButton( onPressed: () async { onTap(index); diff --git a/lib/pages/settings_views/global_settings_view/global_settings_view.dart b/lib/pages/settings_views/global_settings_view/global_settings_view.dart index 86ce2ca36..822a558fa 100644 --- a/lib/pages/settings_views/global_settings_view/global_settings_view.dart +++ b/lib/pages/settings_views/global_settings_view/global_settings_view.dart @@ -15,9 +15,8 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_pr import 'package:stackwallet/pages/settings_views/sub_widgets/settings_list_button.dart'; import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -232,7 +231,7 @@ class GlobalSettingsView extends StatelessWidget { // ?.copyWith( // backgroundColor: // MaterialStateProperty.all( - // CFColors.stackAccent, + // StackTheme.instance.color.accentColorDark // ), // ), // child: Text( diff --git a/lib/pages/settings_views/global_settings_view/hidden_settings.dart b/lib/pages/settings_views/global_settings_view/hidden_settings.dart index 656dc6ec9..d79d77e08 100644 --- a/lib/pages/settings_views/global_settings_view/hidden_settings.dart +++ b/lib/pages/settings_views/global_settings_view/hidden_settings.dart @@ -5,10 +5,9 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/providers/global/debug_service_provider.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; class HiddenSettings extends StatelessWidget { @@ -65,8 +64,8 @@ class HiddenSettings extends StatelessWidget { child: Text( "Delete notifications", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme + .instance.color.accentColorDark), ), ), ); @@ -93,7 +92,7 @@ class HiddenSettings extends StatelessWidget { // child: Text( // "Delete trade history", // style: STextStyles.button.copyWith( - // color: CFColors.stackAccent, + // color: StackTheme.instance.color.accentColorDark // ), // ), // ), @@ -119,8 +118,8 @@ class HiddenSettings extends StatelessWidget { child: Text( "Delete Debug Logs", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme + .instance.color.accentColorDark), ), ), ); @@ -148,7 +147,7 @@ class HiddenSettings extends StatelessWidget { // child: Text( // "Lottie test", // style: STextStyles.button.copyWith( - // color: CFColors.stackAccent, + // color: StackTheme.instance.color.accentColorDark // ), // ), // ), diff --git a/lib/pages/settings_views/global_settings_view/language_view.dart b/lib/pages/settings_views/global_settings_view/language_view.dart index d49c69f62..15a823a57 100644 --- a/lib/pages/settings_views/global_settings_view/language_view.dart +++ b/lib/pages/settings_views/global_settings_view/language_view.dart @@ -3,7 +3,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/languages_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -202,7 +201,7 @@ class _LanguageViewState extends ConsumerState { (context, index) { return Container( decoration: BoxDecoration( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, borderRadius: _borderRadius(index), ), child: Padding( @@ -212,8 +211,8 @@ class _LanguageViewState extends ConsumerState { child: RoundedContainer( padding: const EdgeInsets.all(0), color: index == 0 - ? CFColors.selected - : CFColors.white, + ? StackTheme.instance.color.currencyListItemBG + : StackTheme.instance.color.popupBG, child: RawMaterialButton( onPressed: () async { onTap(index); diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart index 843584ab9..620be4323 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart @@ -11,7 +11,6 @@ import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/providers/global/node_service_provider.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; @@ -119,6 +118,7 @@ class _AddEditNodeViewState extends ConsumerState { case Coin.firo: case Coin.namecoin: case Coin.bitcoinTestNet: + case Coin.bitcoincashTestnet: case Coin.firoTestNet: case Coin.dogecoinTestNet: final client = ElectrumX( @@ -140,17 +140,17 @@ class _AddEditNodeViewState extends ConsumerState { if (showFlushBar) { if (testPassed) { - showFloatingFlushBar( + unawaited(showFloatingFlushBar( type: FlushBarType.success, message: "Server ping success", context: context, - ); + )); } else { - showFloatingFlushBar( + unawaited(showFloatingFlushBar( type: FlushBarType.warning, message: "Server unreachable", context: context, - ); + )); } } @@ -226,7 +226,7 @@ class _AddEditNodeViewState extends ConsumerState { color: StackTheme.instance.color.background, icon: SvgPicture.asset( Assets.svg.trash, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: 20, height: 20, ), @@ -299,8 +299,8 @@ class _AddEditNodeViewState extends ConsumerState { "Test connection", style: STextStyles.button.copyWith( color: testConnectionEnabled - ? CFColors.stackAccent - : CFColors.white, + ? StackTheme.instance.color.textDark + : StackTheme.instance.color.textWhite, ), ), ), @@ -334,8 +334,8 @@ class _AddEditNodeViewState extends ConsumerState { child: Text( "Cancel", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme.instance.color + .accentColorDark), ), ), rightButton: TextButton( @@ -347,10 +347,11 @@ class _AddEditNodeViewState extends ConsumerState { .style ?.copyWith( backgroundColor: - MaterialStateProperty.all< - Color>( - CFColors.stackAccent, - ), + MaterialStateProperty + .all(StackTheme + .instance + .color + .accentColorDark), ), child: Text( "Save", diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart index 6e2c30f73..6fc990cb1 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart @@ -4,10 +4,9 @@ import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart'; import 'package:stackwallet/pages/settings_views/sub_widgets/nodes_list.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:tuple/tuple.dart'; @@ -66,7 +65,7 @@ class _CoinNodesViewState extends ConsumerState { color: StackTheme.instance.color.background, icon: SvgPicture.asset( Assets.svg.plus, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: 20, height: 20, ), diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart index c28beb700..7ea1a48a9 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/manage_nodes_view.dart @@ -4,11 +4,10 @@ import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/manage_nodes_views/coin_nodes_view.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -83,7 +82,7 @@ class _ManageNodesViewState extends ConsumerState { child: RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, diff --git a/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart b/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart index 6d2bda544..4756e30b7 100644 --- a/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart +++ b/lib/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart @@ -7,10 +7,8 @@ import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/electrumx_rpc/electrumx.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/manage_nodes_views/add_edit_node_view.dart'; -import 'package:stackwallet/providers/global/node_service_provider.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; @@ -104,6 +102,9 @@ class _NodeDetailsViewState extends ConsumerState { case Coin.bitcoinTestNet: case Coin.firoTestNet: case Coin.dogecoinTestNet: + case Coin.bitcoincash: + case Coin.namecoin: + case Coin.bitcoincashTestnet: final client = ElectrumX( host: node!.host, port: node.port, @@ -173,7 +174,7 @@ class _NodeDetailsViewState extends ConsumerState { color: StackTheme.instance.color.background, icon: SvgPicture.asset( Assets.svg.pencil, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: 20, height: 20, ), @@ -230,8 +231,8 @@ class _NodeDetailsViewState extends ConsumerState { child: Text( "Test connection", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: + StackTheme.instance.color.accentColorDark), ), ), const SizedBox(height: 16), diff --git a/lib/pages/settings_views/global_settings_view/security_views/change_pin_view/change_pin_view.dart b/lib/pages/settings_views/global_settings_view/security_views/change_pin_view/change_pin_view.dart index b3a9eaeb5..31cf2f9c9 100644 --- a/lib/pages/settings_views/global_settings_view/security_views/change_pin_view/change_pin_view.dart +++ b/lib/pages/settings_views/global_settings_view/security_views/change_pin_view/change_pin_view.dart @@ -4,7 +4,6 @@ import 'package:google_fonts/google_fonts.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/security_views/security_view.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; @@ -32,8 +31,9 @@ class ChangePinView extends StatefulWidget { class _ChangePinViewState extends State { BoxDecoration get _pinPutDecoration { return BoxDecoration( - color: CFColors.gray3, - border: Border.all(width: 1, color: CFColors.gray3), + color: StackTheme.instance.color.textSubtitle2, + border: + Border.all(width: 1, color: StackTheme.instance.color.textSubtitle2), borderRadius: BorderRadius.circular(6), ); } diff --git a/lib/pages/settings_views/global_settings_view/security_views/security_view.dart b/lib/pages/settings_views/global_settings_view/security_views/security_view.dart index 73b4ce560..7e2ca290e 100644 --- a/lib/pages/settings_views/global_settings_view/security_views/security_view.dart +++ b/lib/pages/settings_views/global_settings_view/security_views/security_view.dart @@ -4,10 +4,9 @@ import 'package:stackwallet/pages/pinpad_views/lock_screen_view.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/security_views/change_pin_view/change_pin_view.dart'; import 'package:stackwallet/providers/global/prefs_provider.dart'; import 'package:stackwallet/route_generator.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -44,7 +43,7 @@ class SecurityView extends StatelessWidget { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( @@ -93,7 +92,7 @@ class SecurityView extends StatelessWidget { child: Consumer( builder: (_, ref, __) { return RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart index 8e5c3d840..a58ad1326 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/auto_backup_view.dart @@ -6,7 +6,6 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/stack_back import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/edit_auto_backup_view.dart'; import 'package:stackwallet/providers/global/auto_swb_service_provider.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/backup_frequency_type.dart'; import 'package:stackwallet/utilities/format.dart'; @@ -86,7 +85,7 @@ class _AutoBackupViewState extends ConsumerState { child: Text( "Back", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, ), ), onPressed: () { @@ -96,7 +95,7 @@ class _AutoBackupViewState extends ConsumerState { rightButton: TextButton( style: Theme.of(context).textButtonTheme.style?.copyWith( backgroundColor: MaterialStateProperty.all( - CFColors.stackAccent, + StackTheme.instance.color.accentColorDark, ), ), child: Text( @@ -142,7 +141,7 @@ class _AutoBackupViewState extends ConsumerState { child: Text( "Back", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, ), ), onPressed: () { @@ -152,7 +151,7 @@ class _AutoBackupViewState extends ConsumerState { rightButton: TextButton( style: Theme.of(context).textButtonTheme.style?.copyWith( backgroundColor: MaterialStateProperty.all( - CFColors.stackAccent, + StackTheme.instance.color.accentColorDark, ), ), child: Text( @@ -243,7 +242,7 @@ class _AutoBackupViewState extends ConsumerState { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( @@ -356,7 +355,8 @@ class _AutoBackupViewState extends ConsumerState { controller: fileLocationController, enabled: false, style: STextStyles.field.copyWith( - color: CFColors.stackAccent.withOpacity(0.5), + color: + StackTheme.instance.color.textDark.withOpacity(0.5), ), readOnly: true, enableSuggestions: false, @@ -386,7 +386,8 @@ class _AutoBackupViewState extends ConsumerState { controller: passwordController, enabled: false, style: STextStyles.field.copyWith( - color: CFColors.stackAccent.withOpacity(0.5), + color: + StackTheme.instance.color.textDark.withOpacity(0.5), ), obscureText: true, enableSuggestions: false, @@ -418,7 +419,8 @@ class _AutoBackupViewState extends ConsumerState { controller: frequencyController, enabled: false, style: STextStyles.field.copyWith( - color: CFColors.stackAccent.withOpacity(0.5), + color: + StackTheme.instance.color.textDark.withOpacity(0.5), ), toolbarOptions: const ToolbarOptions( copy: true, diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_auto_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_auto_backup_view.dart index a31ba859a..dc180d37a 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_auto_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_auto_backup_view.dart @@ -14,7 +14,6 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/stack_back import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/sub_views/backup_frequency_type_select_sheet.dart'; import 'package:stackwallet/providers/global/prefs_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; @@ -165,7 +164,7 @@ class _EnableAutoBackupViewState extends ConsumerState { ), SvgPicture.asset( Assets.svg.folder, - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, width: 16, height: 16, ), @@ -224,7 +223,7 @@ class _EnableAutoBackupViewState extends ConsumerState { hidePassword ? Assets.svg.eye : Assets.svg.eyeSlash, - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, width: 16, height: 16, ), @@ -350,7 +349,7 @@ class _EnableAutoBackupViewState extends ConsumerState { hidePassword ? Assets.svg.eye : Assets.svg.eyeSlash, - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, width: 16, height: 16, ), @@ -386,7 +385,7 @@ class _EnableAutoBackupViewState extends ConsumerState { ), Positioned.fill( child: RawMaterialButton( - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -423,7 +422,8 @@ class _EnableAutoBackupViewState extends ConsumerState { padding: const EdgeInsets.only(right: 4.0), child: SvgPicture.asset( Assets.svg.chevronDown, - color: CFColors.gray3, + color: StackTheme + .instance.color.textSubtitle2, width: 12, height: 6, ), diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_information_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_information_view.dart index 1719f3a37..81751717f 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_information_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_information_view.dart @@ -1,8 +1,7 @@ import 'package:flutter/material.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -69,8 +68,7 @@ class CreateBackupInfoView extends StatelessWidget { .style ?.copyWith( backgroundColor: MaterialStateProperty.all( - CFColors.stackAccent, - ), + StackTheme.instance.color.accentColorDark), ), onPressed: () { Navigator.of(context) diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart index a885c38ee..40db27635 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart @@ -9,7 +9,6 @@ import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/helpers/restore_create_backup.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/helpers/stack_file_system.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/logger.dart'; @@ -165,7 +164,8 @@ class _RestoreFromFileViewState extends State { ), SvgPicture.asset( Assets.svg.folder, - color: CFColors.neutral50, + color: + StackTheme.instance.color.textDark3, width: 16, height: 16, ), @@ -228,7 +228,8 @@ class _RestoreFromFileViewState extends State { hidePassword ? Assets.svg.eye : Assets.svg.eyeSlash, - color: CFColors.neutral50, + color: + StackTheme.instance.color.textDark3, width: 16, height: 16, ), @@ -357,7 +358,8 @@ class _RestoreFromFileViewState extends State { hidePassword ? Assets.svg.eye : Assets.svg.eyeSlash, - color: CFColors.neutral50, + color: + StackTheme.instance.color.textDark3, width: 16, height: 16, ), diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/dialogs/cancel_stack_restore_dialog.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/dialogs/cancel_stack_restore_dialog.dart index d8310078d..2f6accef4 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/dialogs/cancel_stack_restore_dialog.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/dialogs/cancel_stack_restore_dialog.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/stack_dialog.dart'; @@ -34,7 +33,7 @@ class CancelStackRestoreDialog extends StatelessWidget { child: Text( "Yes, cancel", style: STextStyles.itemSubtitle12.copyWith( - color: CFColors.white, + color: StackTheme.instance.color.buttonTextPrimary, ), ), onPressed: () { diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/edit_auto_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/edit_auto_backup_view.dart index d54939c61..44ca028e6 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/edit_auto_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/edit_auto_backup_view.dart @@ -14,7 +14,6 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/stack_back import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/sub_views/backup_frequency_type_select_sheet.dart'; import 'package:stackwallet/providers/global/prefs_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; @@ -167,7 +166,7 @@ class _EditAutoBackupViewState extends ConsumerState { ), SvgPicture.asset( Assets.svg.folder, - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, width: 16, height: 16, ), @@ -226,7 +225,7 @@ class _EditAutoBackupViewState extends ConsumerState { hidePassword ? Assets.svg.eye : Assets.svg.eyeSlash, - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, width: 16, height: 16, ), @@ -352,7 +351,7 @@ class _EditAutoBackupViewState extends ConsumerState { hidePassword ? Assets.svg.eye : Assets.svg.eyeSlash, - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, width: 16, height: 16, ), @@ -388,7 +387,7 @@ class _EditAutoBackupViewState extends ConsumerState { ), Positioned.fill( child: RawMaterialButton( - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -425,7 +424,8 @@ class _EditAutoBackupViewState extends ConsumerState { padding: const EdgeInsets.only(right: 4.0), child: SvgPicture.asset( Assets.svg.chevronDown, - color: CFColors.gray3, + color: StackTheme + .instance.color.textSubtitle2, width: 12, height: 6, ), diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart index 5e73f1ea1..f38438f2b 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_encrypted_string_view.dart @@ -8,7 +8,6 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/stack_back import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart'; import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -129,7 +128,8 @@ class _RestoreFromEncryptedStringViewState hidePassword ? Assets.svg.eye : Assets.svg.eyeSlash, - color: CFColors.neutral50, + color: + StackTheme.instance.color.textDark3, width: 16, height: 16, ), @@ -189,7 +189,8 @@ class _RestoreFromEncryptedStringViewState "Decrypting Stack backup file", style: STextStyles.pageTitleH2 .copyWith( - color: CFColors.white, + color: StackTheme + .instance.color.textWhite, ), ), ), diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart index 24f7384a6..a8a17fd61 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart @@ -10,7 +10,6 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/stack_back import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart'; import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/logger.dart'; @@ -139,7 +138,7 @@ class _RestoreFromFileViewState extends ConsumerState { ), SvgPicture.asset( Assets.svg.folder, - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, width: 16, height: 16, ), @@ -197,7 +196,8 @@ class _RestoreFromFileViewState extends ConsumerState { hidePassword ? Assets.svg.eye : Assets.svg.eyeSlash, - color: CFColors.neutral50, + color: + StackTheme.instance.color.textDark3, width: 16, height: 16, ), @@ -270,7 +270,8 @@ class _RestoreFromFileViewState extends ConsumerState { "Decrypting Stack backup file", style: STextStyles.pageTitleH2 .copyWith( - color: CFColors.white, + color: StackTheme + .instance.color.textWhite, ), ), ), diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/stack_backup_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/stack_backup_view.dart index c2a64bfa9..a60c19acd 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/stack_backup_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/stack_backup_view.dart @@ -4,10 +4,9 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/stack_back import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/create_backup_view.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/stack_backup_views/restore_from_file_view.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -43,7 +42,7 @@ class StackBackupView extends StatelessWidget { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( @@ -84,7 +83,7 @@ class StackBackupView extends StatelessWidget { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( @@ -126,7 +125,7 @@ class StackBackupView extends StatelessWidget { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/backup_frequency_type_select_sheet.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/backup_frequency_type_select_sheet.dart index 55baef6e9..b8c034efa 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/backup_frequency_type_select_sheet.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/backup_frequency_type_select_sheet.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/global/prefs_provider.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/backup_frequency_type.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -32,9 +31,9 @@ class BackupFrequencyTypeSelectSheet extends ConsumerWidget { return false; }, child: Container( - decoration: const BoxDecoration( - color: CFColors.white, - borderRadius: BorderRadius.vertical( + decoration: BoxDecoration( + color: StackTheme.instance.color.popupBG, + borderRadius: const BorderRadius.vertical( top: Radius.circular(20), ), ), diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart index 366f974d3..7dfd1be13 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_views/stack_restore_progress_view.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -11,7 +13,6 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/stack_back import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/stack_restore/stack_restoring_ui_state_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/enums/stack_restoring_status.dart'; import 'package:stackwallet/utilities/logger.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -40,7 +41,7 @@ class _StackRestoreProgressViewState extends ConsumerState { Future _cancel() async { bool shouldPop = false; - showDialog( + unawaited(showDialog( barrierDismissible: false, context: context, builder: (_) => WillPopScope( @@ -57,7 +58,7 @@ class _StackRestoreProgressViewState child: Text( "Cancelling restore. Please wait.", style: STextStyles.pageTitleH2.copyWith( - color: CFColors.white, + color: StackTheme.instance.color.textWhite, ), ), ), @@ -73,7 +74,7 @@ class _StackRestoreProgressViewState ], ), ), - ); + )); await SWB.cancelRestore(); shouldPop = true; @@ -245,7 +246,8 @@ class _StackRestoreProgressViewState Assets.svg.gear, width: 16, height: 16, - color: CFColors.stackAccent, + color: + StackTheme.instance.color.accentColorDark, ), ), ), @@ -280,11 +282,12 @@ class _StackRestoreProgressViewState padding: const EdgeInsets.all(0), color: StackTheme.instance.color.buttonBackSecondary, - child: const Center( + child: Center( child: AddressBookIcon( width: 16, height: 16, - color: CFColors.stackAccent, + color: + StackTheme.instance.color.accentColorDark, ), ), ), @@ -324,7 +327,8 @@ class _StackRestoreProgressViewState Assets.svg.node, width: 16, height: 16, - color: CFColors.stackAccent, + color: + StackTheme.instance.color.accentColorDark, ), ), ), @@ -364,7 +368,8 @@ class _StackRestoreProgressViewState Assets.svg.arrowRotate2, width: 16, height: 16, - color: CFColors.stackAccent, + color: + StackTheme.instance.color.accentColorDark, ), ), ), @@ -428,10 +433,11 @@ class _StackRestoreProgressViewState } } }, + style: StackTheme.instance.getSecondaryEnabledButtonColor(context), child: Text( _success ? "OK" : "Cancel restore process", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.buttonTextPrimary, ), ), ), diff --git a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_wallet_card.dart b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_wallet_card.dart index bb6e6f00c..1c2019348 100644 --- a/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_wallet_card.dart +++ b/lib/pages/settings_views/global_settings_view/stack_backup_views/sub_widgets/restoring_wallet_card.dart @@ -7,7 +7,6 @@ import 'package:stackwallet/pages/settings_views/global_settings_view/stack_back import 'package:stackwallet/providers/stack_restore/stack_restoring_ui_state_provider.dart'; import 'package:stackwallet/route_generator.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/stack_restoring_status.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -36,7 +35,7 @@ class _RestoringWalletCardState extends ConsumerState { case StackRestoringStatus.waiting: return SvgPicture.asset( Assets.svg.loader, - color:StackTheme.instance.color.buttonBackSecondary, + color: StackTheme.instance.color.buttonBackSecondary, ); case StackRestoringStatus.restoring: return const LoadingIndicator(); @@ -74,7 +73,7 @@ class _RestoringWalletCardState extends ConsumerState { height: 32, child: RoundedContainer( padding: const EdgeInsets.all(0), - color: CFColors.coin.forCoin(coin), + color: StackTheme.instance.colorForCoin(coin), child: Center( child: SvgPicture.asset( Assets.svg.iconFor( @@ -163,7 +162,7 @@ class _RestoringWalletCardState extends ConsumerState { ), child: RawMaterialButton( materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( 1000, @@ -188,8 +187,7 @@ class _RestoringWalletCardState extends ConsumerState { child: Text( "Show recovery phrase", style: STextStyles.infoSmall.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme.instance.color.accentColorDark), ), ), ), diff --git a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart index 0b96b5219..56950d0fc 100644 --- a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart +++ b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_preferences_view.dart @@ -56,7 +56,7 @@ class _StartupPreferencesViewState Padding( padding: const EdgeInsets.all(4.0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( @@ -129,7 +129,7 @@ class _StartupPreferencesViewState Padding( padding: const EdgeInsets.all(4), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( @@ -224,7 +224,7 @@ class _StartupPreferencesViewState ), Flexible( child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( diff --git a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart index 6c8b37ac8..f39b95367 100644 --- a/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart +++ b/lib/pages/settings_views/global_settings_view/startup_preferences/startup_wallet_selection_view.dart @@ -3,7 +3,6 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; @@ -91,8 +90,8 @@ class _StartupWalletSelectionViewState children: [ Container( decoration: BoxDecoration( - color: CFColors.coin - .forCoin(manager.coin) + color: StackTheme.instance + .colorForCoin(manager.coin) .withOpacity(0.5), borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, diff --git a/lib/pages/settings_views/global_settings_view/support_view.dart b/lib/pages/settings_views/global_settings_view/support_view.dart index c42cbcb18..a820b9220 100644 --- a/lib/pages/settings_views/global_settings_view/support_view.dart +++ b/lib/pages/settings_views/global_settings_view/support_view.dart @@ -1,10 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; import 'package:url_launcher/url_launcher.dart'; @@ -51,7 +50,7 @@ class SupportView extends StatelessWidget { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( @@ -95,7 +94,7 @@ class SupportView extends StatelessWidget { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( @@ -139,7 +138,7 @@ class SupportView extends StatelessWidget { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( @@ -183,7 +182,7 @@ class SupportView extends StatelessWidget { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( @@ -227,7 +226,7 @@ class SupportView extends StatelessWidget { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( diff --git a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart index b589b4e85..4e4562f59 100644 --- a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart +++ b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart @@ -49,7 +49,7 @@ class SyncingOptionsView extends ConsumerWidget { Padding( padding: const EdgeInsets.all(4), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( @@ -139,7 +139,7 @@ class SyncingOptionsView extends ConsumerWidget { Padding( padding: const EdgeInsets.all(4.0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( @@ -227,7 +227,7 @@ class SyncingOptionsView extends ConsumerWidget { Padding( padding: const EdgeInsets.all(4), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( @@ -343,7 +343,7 @@ class SyncingOptionsView extends ConsumerWidget { ), Flexible( child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( diff --git a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart index 3b2e5f1a4..3f60cd9c3 100644 --- a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart +++ b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_preferences_view.dart @@ -2,11 +2,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/syncing_preferences_views/syncing_options_view.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/sync_type_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -58,7 +57,7 @@ class SyncingPreferencesView extends ConsumerWidget { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, padding: const EdgeInsets.all(0), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, @@ -105,7 +104,7 @@ class SyncingPreferencesView extends ConsumerWidget { child: Consumer( builder: (_, ref, __) { return RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( diff --git a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart index c07cb58a8..12d69225c 100644 --- a/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart +++ b/lib/pages/settings_views/global_settings_view/syncing_preferences_views/wallet_syncing_options_view.dart @@ -4,13 +4,12 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/sync_type_enum.dart'; import 'package:stackwallet/utilities/format.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/animated_text.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/custom_buttons/draggable_switch_button.dart'; @@ -83,8 +82,8 @@ class WalletSyncingOptionsView extends ConsumerWidget { children: [ Container( decoration: BoxDecoration( - color: CFColors.coin - .forCoin(manager.coin) + color: StackTheme.instance + .colorForCoin(manager.coin) .withOpacity(0.5), borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, diff --git a/lib/pages/settings_views/sub_widgets/settings_list_button.dart b/lib/pages/settings_views/sub_widgets/settings_list_button.dart index 636ebace7..33b463d1f 100644 --- a/lib/pages/settings_views/sub_widgets/settings_list_button.dart +++ b/lib/pages/settings_views/sub_widgets/settings_list_button.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; @@ -22,7 +21,7 @@ class SettingsListButton extends StatelessWidget { @override Widget build(BuildContext context) { return RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, constraints: const BoxConstraints( minHeight: 32, minWidth: 32, @@ -52,7 +51,7 @@ class SettingsListButton extends StatelessWidget { child: Center( child: SvgPicture.asset( iconAssetName, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: iconSize, height: iconSize, ), @@ -67,7 +66,7 @@ class SettingsListButton extends StatelessWidget { child: Text( title, style: STextStyles.smallMed14.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, ), ), ), diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart index f2c1e6d1f..57f6899f6 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_backup_views/wallet_backup_view.dart @@ -8,7 +8,6 @@ import 'package:stackwallet/pages/add_wallet_views/new_wallet_recovery_phrase_vi import 'package:stackwallet/providers/global/wallets_provider.dart'; import 'package:stackwallet/utilities/address_utils.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; @@ -105,7 +104,7 @@ class WalletBackupView extends ConsumerWidget { ), Container( decoration: BoxDecoration( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, borderRadius: BorderRadius.circular(Constants.size.circularBorderRadius), ), @@ -134,8 +133,7 @@ class WalletBackupView extends ConsumerWidget { TextButton( style: Theme.of(context).textButtonTheme.style?.copyWith( backgroundColor: MaterialStateProperty.all( - CFColors.stackAccent, - ), + StackTheme.instance.color.accentColorDark), ), onPressed: () { String data = AddressUtils.encodeQRSeedData(mnemonic); @@ -166,11 +164,12 @@ class WalletBackupView extends ConsumerWidget { width: width + 20, height: width + 20, child: QrImage( - data: data, - size: width, - backgroundColor: CFColors.white, - foregroundColor: CFColors.stackAccent, - ), + data: data, + size: width, + backgroundColor: + StackTheme.instance.color.popupBG, + foregroundColor: StackTheme + .instance.color.accentColorDark), ), ), ), @@ -190,8 +189,8 @@ class WalletBackupView extends ConsumerWidget { child: Text( "Cancel", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme + .instance.color.accentColorDark), ), ), ), diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/sub_widgets/rescanning_dialog.dart b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/sub_widgets/rescanning_dialog.dart index 77207efe3..6f713b8fb 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/sub_widgets/rescanning_dialog.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/sub_widgets/rescanning_dialog.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/stack_dialog.dart'; @@ -63,7 +62,7 @@ class _RescanningDialogState extends State Assets.svg.arrowRotate3, width: 24, height: 24, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, ), ), // rightButton: TextButton( diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart index dd9c32792..cede8e4f6 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_network_settings_view/wallet_network_settings_view.dart @@ -18,7 +18,6 @@ import 'package:stackwallet/services/event_bus/events/global/refresh_percent_cha import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import 'package:stackwallet/services/event_bus/global_event_bus.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -309,7 +308,7 @@ class _WalletNetworkSettingsViewState color: StackTheme.instance.color.background, icon: SvgPicture.asset( Assets.svg.verticalEllipsis, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: 20, height: 20, ), @@ -326,7 +325,7 @@ class _WalletNetworkSettingsViewState right: 10, child: Container( decoration: BoxDecoration( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius), // boxShadow: [CFColors.standardBoxShadow], @@ -631,7 +630,7 @@ class _WalletNetworkSettingsViewState top: 12, ), child: RoundedContainer( - color: CFColors.warningBackground, + color: StackTheme.instance.color.warningBackground, child: Text( "Please check your internet connection and make sure your current node is not having issues.", style: STextStyles.baseXS, diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart index 8953872c5..ba55644dc 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_view.dart @@ -22,7 +22,6 @@ import 'package:stackwallet/services/event_bus/events/global/node_connection_sta import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import 'package:stackwallet/services/event_bus/global_event_bus.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -303,8 +302,8 @@ class _WalletSettingsViewState extends State { child: Text( "Log out", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme + .instance.color.accentColorDark), ), ); }, @@ -406,9 +405,8 @@ class _EpiBoxInfoFormState extends ConsumerState { }, child: Text( "Save", - style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + style: STextStyles.button + .copyWith(color: StackTheme.instance.color.accentColorDark), ), ), ], diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart index e75d4e36d..5a5e2534c 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart @@ -8,7 +8,6 @@ import 'package:stackwallet/pages/home_view/home_view.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/clipboard_interface.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; @@ -120,7 +119,7 @@ class _DeleteWalletRecoveryPhraseViewState ), Container( decoration: BoxDecoration( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, borderRadius: BorderRadius.circular(Constants.size.circularBorderRadius), ), @@ -129,8 +128,7 @@ class _DeleteWalletRecoveryPhraseViewState child: Text( "Please write down your recovery phrase in the correct order and save it to keep your funds secure. You will also be asked to verify the words on the next screen.", style: STextStyles.label.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme.instance.color.accentColorDark), ), ), ), @@ -151,8 +149,7 @@ class _DeleteWalletRecoveryPhraseViewState TextButton( style: Theme.of(context).textButtonTheme.style?.copyWith( backgroundColor: MaterialStateProperty.all( - CFColors.stackAccent, - ), + StackTheme.instance.color.accentColorDark), ), onPressed: () { showDialog( @@ -169,15 +166,13 @@ class _DeleteWalletRecoveryPhraseViewState child: Text( "Cancel", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme.instance.color.accentColorDark), ), ), rightButton: TextButton( style: Theme.of(context).textButtonTheme.style?.copyWith( backgroundColor: MaterialStateProperty.all( - CFColors.stackAccent, - ), + StackTheme.instance.color.accentColorDark), ), onPressed: () async { final walletId = _manager.walletId; diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_warning_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_warning_view.dart index 456cce9f8..b26139ff8 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_warning_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_warning_view.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/delete_wallet_recovery_phrase_view.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; @@ -52,7 +51,7 @@ class DeleteWalletWarningView extends ConsumerWidget { height: 16, ), RoundedContainer( - color: CFColors.warningBackground, + color: StackTheme.instance.color.warningBackground, child: Text( "You are going to permanently delete you wallet.\n\nIf you delete your wallet, the only way you can have access to your funds is by using your backup key.\n\nStack Wallet does not keep nor is able to restore your backup key or your wallet.\n\nPLEASE SAVE YOUR BACKUP KEY.", style: STextStyles.baseXS, @@ -67,9 +66,8 @@ class DeleteWalletWarningView extends ConsumerWidget { }, child: Text( "Cancel", - style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + style: STextStyles.button + .copyWith(color: StackTheme.instance.color.accentColorDark), ), ), const SizedBox( @@ -78,8 +76,7 @@ class DeleteWalletWarningView extends ConsumerWidget { TextButton( style: Theme.of(context).textButtonTheme.style?.copyWith( backgroundColor: MaterialStateProperty.all( - CFColors.stackAccent, - ), + StackTheme.instance.color.accentColorDark), ), onPressed: () async { final manager = ref diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/rename_wallet_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/rename_wallet_view.dart index aee05347d..c119fe795 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/rename_wallet_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/rename_wallet_view.dart @@ -2,11 +2,10 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/icon_widgets/x_icon.dart'; import 'package:stackwallet/widgets/stack_text_field.dart'; @@ -109,8 +108,7 @@ class _RenameWalletViewState extends ConsumerState { TextButton( style: Theme.of(context).textButtonTheme.style?.copyWith( backgroundColor: MaterialStateProperty.all( - CFColors.stackAccent, - ), + StackTheme.instance.color.accentColorDark), ), onPressed: () async { final newName = _controller.text; diff --git a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart index 09cf75567..6fe687d3b 100644 --- a/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart +++ b/lib/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/wallet_settings_wallet_settings_view.dart @@ -5,7 +5,6 @@ import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_set import 'package:stackwallet/pages/settings_views/wallet_settings_view/wallet_settings_wallet_settings/rename_wallet_view.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/route_generator.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; @@ -51,7 +50,7 @@ class WalletSettingsWalletSettingsView extends ConsumerWidget { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -86,7 +85,7 @@ class WalletSettingsWalletSettingsView extends ConsumerWidget { RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, @@ -110,18 +109,19 @@ class WalletSettingsWalletSettingsView extends ConsumerWidget { child: Text( "Cancel", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: + StackTheme.instance.color.accentColorDark), ), ), rightButton: TextButton( - style: - Theme.of(context).textButtonTheme.style?.copyWith( - backgroundColor: - MaterialStateProperty.all( - CFColors.stackAccent, - ), - ), + style: Theme.of(context) + .textButtonTheme + .style + ?.copyWith( + backgroundColor: + MaterialStateProperty.all(StackTheme + .instance.color.accentColorDark), + ), onPressed: () { Navigator.pop(context); Navigator.push( diff --git a/lib/pages/wallet_view/sub_widgets/transactions_list.dart b/lib/pages/wallet_view/sub_widgets/transactions_list.dart index 42abd2f8f..1af56c8d8 100644 --- a/lib/pages/wallet_view/sub_widgets/transactions_list.dart +++ b/lib/pages/wallet_view/sub_widgets/transactions_list.dart @@ -6,9 +6,8 @@ import 'package:stackwallet/models/paymint/transactions_model.dart'; import 'package:stackwallet/pages/wallet_view/sub_widgets/no_transactions_found.dart'; import 'package:stackwallet/providers/global/wallets_provider.dart'; import 'package:stackwallet/services/coins/manager.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/loading_indicator.dart'; import 'package:stackwallet/widgets/transaction_card.dart'; @@ -128,7 +127,7 @@ class _TransactionsListState extends ConsumerState { final tx = list[index]; return Container( decoration: BoxDecoration( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, borderRadius: radius, ), child: TransactionCard( diff --git a/lib/pages/wallet_view/sub_widgets/wallet_balance_toggle_sheet.dart b/lib/pages/wallet_view/sub_widgets/wallet_balance_toggle_sheet.dart index d17e13e8f..5e7b61ba0 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_balance_toggle_sheet.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_balance_toggle_sheet.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/wallet/wallet_balance_toggle_state_provider.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/wallet_balance_toggle_state.dart'; @@ -25,9 +24,9 @@ class WalletBalanceToggleSheet extends ConsumerWidget { .select((value) => value.getManager(walletId).coin)); return Container( - decoration: const BoxDecoration( - color: CFColors.white, - borderRadius: BorderRadius.vertical( + decoration: BoxDecoration( + color: StackTheme.instance.color.popupBG, + borderRadius: const BorderRadius.vertical( top: Radius.circular(20), ), ), @@ -126,7 +125,7 @@ class WalletBalanceToggleSheet extends ConsumerWidget { Text( "Current spendable (unlocked) balance", style: STextStyles.itemSubtitle12.copyWith( - color: CFColors.neutral60, + color: StackTheme.instance.color.textSubtitle1, ), ), ], @@ -145,7 +144,7 @@ class WalletBalanceToggleSheet extends ConsumerWidget { Text( "Current private spendable (unlocked) balance", style: STextStyles.itemSubtitle12.copyWith( - color: CFColors.neutral60, + color: StackTheme.instance.color.textSubtitle1, ), ), ], @@ -213,7 +212,7 @@ class WalletBalanceToggleSheet extends ConsumerWidget { Text( "Total wallet balance", style: STextStyles.itemSubtitle12.copyWith( - color: CFColors.neutral60, + color: StackTheme.instance.color.textSubtitle1, ), ), ], @@ -232,7 +231,7 @@ class WalletBalanceToggleSheet extends ConsumerWidget { Text( "Current public spendable (unlocked) balance", style: STextStyles.itemSubtitle12.copyWith( - color: CFColors.neutral60, + color: StackTheme.instance.color.textSubtitle1, ), ), ], diff --git a/lib/pages/wallet_view/sub_widgets/wallet_navigation_bar.dart b/lib/pages/wallet_view/sub_widgets/wallet_navigation_bar.dart index d418ad497..6c0dea5ba 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_navigation_bar.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_navigation_bar.dart @@ -1,9 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; class WalletNavigationBar extends StatelessWidget { const WalletNavigationBar({ @@ -28,8 +27,8 @@ class WalletNavigationBar extends StatelessWidget { return Container( height: height, decoration: BoxDecoration( - color: CFColors.white, - boxShadow: const [CFColors.standardBoxShadow], + color: StackTheme.instance.color.popupBG, + boxShadow: [StackTheme.instance.standardBoxShadow], borderRadius: BorderRadius.circular( height / 2.0, ), @@ -50,7 +49,7 @@ class WalletNavigationBar extends StatelessWidget { minWidth: 66, ), onPressed: onReceivePressed, - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( height / 2.0, @@ -66,7 +65,8 @@ class WalletNavigationBar extends StatelessWidget { const Spacer(), Container( decoration: BoxDecoration( - color: CFColors.stackAccent.withOpacity(0.4), + color: StackTheme.instance.color.accentColorDark + .withOpacity(0.4), borderRadius: BorderRadius.circular( 24, ), @@ -77,7 +77,7 @@ class WalletNavigationBar extends StatelessWidget { Assets.svg.arrowDownLeft, width: 12, height: 12, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, ), ), ), @@ -99,7 +99,7 @@ class WalletNavigationBar extends StatelessWidget { minWidth: 66, ), onPressed: onSendPressed, - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( height / 2.0, @@ -115,7 +115,8 @@ class WalletNavigationBar extends StatelessWidget { const Spacer(), Container( decoration: BoxDecoration( - color: CFColors.stackAccent.withOpacity(0.4), + color: StackTheme.instance.color.accentColorDark + .withOpacity(0.4), borderRadius: BorderRadius.circular( 24, ), @@ -126,7 +127,7 @@ class WalletNavigationBar extends StatelessWidget { Assets.svg.arrowUpRight, width: 12, height: 12, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, ), ), ), @@ -149,7 +150,7 @@ class WalletNavigationBar extends StatelessWidget { minWidth: 66, ), onPressed: onExchangePressed, - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular( height / 2.0, @@ -237,7 +238,7 @@ class WalletNavigationBar extends StatelessWidget { // Widget build(BuildContext context) { // return Container( // child: MaterialButton( -// splashColor: CFColors.splashLight, +// splashColor: StackTheme.instance.color.highlight, // padding: const EdgeInsets.all(0), // minWidth: 45, // shape: RoundedRectangleBorder( diff --git a/lib/pages/wallet_view/sub_widgets/wallet_refresh_button.dart b/lib/pages/wallet_view/sub_widgets/wallet_refresh_button.dart index ed467681f..c916226c8 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_refresh_button.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_refresh_button.dart @@ -8,9 +8,8 @@ import 'package:stackwallet/providers/global/wallets_provider.dart'; import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import 'package:stackwallet/services/event_bus/global_event_bus.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; /// [eventBus] should only be set during testing class WalletRefreshButton extends ConsumerStatefulWidget { @@ -97,7 +96,7 @@ class _RefreshButtonState extends ConsumerState height: 36, width: 36, child: MaterialButton( - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, onPressed: () { final managerProvider = ref .read(walletsChangeNotifierProvider) @@ -124,7 +123,7 @@ class _RefreshButtonState extends ConsumerState Assets.svg.arrowRotate, width: 24, height: 24, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, ), ), ), diff --git a/lib/pages/wallet_view/sub_widgets/wallet_summary.dart b/lib/pages/wallet_view/sub_widgets/wallet_summary.dart index 1703998fb..a4800594a 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_summary.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_summary.dart @@ -5,9 +5,8 @@ import 'package:stackwallet/pages/wallet_view/sub_widgets/wallet_summary_info.da import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; class WalletSummary extends StatelessWidget { const WalletSummary({ @@ -49,7 +48,7 @@ class WalletSummary extends StatelessWidget { builder: (_, ref, __) { return Container( decoration: BoxDecoration( - color: CFColors.coin.forCoin(ref + color: StackTheme.instance.colorForCoin(ref .watch(managerProvider.select((value) => value.coin))), borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, diff --git a/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart b/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart index e1930d610..7e261fbe9 100644 --- a/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart +++ b/lib/pages/wallet_view/sub_widgets/wallet_summary_info.dart @@ -10,12 +10,11 @@ import 'package:stackwallet/services/coins/firo/firo_wallet.dart'; import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/wallet_balance_toggle_state.dart'; import 'package:stackwallet/utilities/format.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/animated_text.dart'; class WalletSummaryInfo extends StatefulWidget { @@ -145,7 +144,8 @@ class _WalletSummaryInfoState extends State { ), SvgPicture.asset( Assets.svg.chevronDown, - color: CFColors.stackAccent, + color: + StackTheme.instance.color.accentColorDark, width: 8, height: 4, ), @@ -205,7 +205,8 @@ class _WalletSummaryInfoState extends State { ), SvgPicture.asset( Assets.svg.chevronDown, - color: CFColors.stackAccent, + color: + StackTheme.instance.color.accentColorDark, width: 8, height: 4, ), diff --git a/lib/pages/wallet_view/transaction_views/all_transactions_view.dart b/lib/pages/wallet_view/transaction_views/all_transactions_view.dart index c23058124..979925a42 100644 --- a/lib/pages/wallet_view/transaction_views/all_transactions_view.dart +++ b/lib/pages/wallet_view/transaction_views/all_transactions_view.dart @@ -9,10 +9,9 @@ import 'package:stackwallet/providers/global/address_book_service_provider.dart' import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/ui/transaction_filter_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/icon_widgets/x_icon.dart'; import 'package:stackwallet/widgets/loading_indicator.dart'; @@ -200,7 +199,7 @@ class _TransactionDetailsViewState extends ConsumerState { color: StackTheme.instance.color.background, icon: SvgPicture.asset( Assets.svg.filter, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: 20, height: 20, ), diff --git a/lib/pages/wallet_view/transaction_views/dialogs/cancelling_transaction_progress_dialog.dart b/lib/pages/wallet_view/transaction_views/dialogs/cancelling_transaction_progress_dialog.dart index f4c68de55..9bd5f7b26 100644 --- a/lib/pages/wallet_view/transaction_views/dialogs/cancelling_transaction_progress_dialog.dart +++ b/lib/pages/wallet_view/transaction_views/dialogs/cancelling_transaction_progress_dialog.dart @@ -2,7 +2,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/stack_dialog.dart'; @@ -58,7 +57,7 @@ class _CancellingTransactionProgressDialogState Assets.svg.arrowRotate3, width: 24, height: 24, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, ), ), // rightButton: TextButton( diff --git a/lib/pages/wallet_view/transaction_views/edit_note_view.dart b/lib/pages/wallet_view/transaction_views/edit_note_view.dart index c421783ff..bf529fd47 100644 --- a/lib/pages/wallet_view/transaction_views/edit_note_view.dart +++ b/lib/pages/wallet_view/transaction_views/edit_note_view.dart @@ -1,10 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/icon_widgets/x_icon.dart'; import 'package:stackwallet/widgets/stack_text_field.dart'; @@ -130,13 +129,14 @@ class _EditNoteViewState extends ConsumerState { Navigator.of(context).pop(); } }, - style: - Theme.of(context).textButtonTheme.style?.copyWith( - backgroundColor: - MaterialStateProperty.all( - CFColors.stackAccent, - ), - ), + style: Theme.of(context) + .textButtonTheme + .style + ?.copyWith( + backgroundColor: + MaterialStateProperty.all(StackTheme + .instance.color.accentColorDark), + ), child: Text( "Save", style: STextStyles.button, diff --git a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart index 4e47418de..87969020a 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_details_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_details_view.dart @@ -16,7 +16,6 @@ import 'package:stackwallet/services/coins/epiccash/epiccash_wallet.dart'; import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/utilities/assets.dart'; import 'package:stackwallet/utilities/block_explorers.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; @@ -180,9 +179,8 @@ class _TransactionDetailsViewState }, child: Text( "Cancel", - style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + style: STextStyles.button + .copyWith(color: StackTheme.instance.color.accentColorDark), ), ), rightButton: TextButton( diff --git a/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart b/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart index ed385b1c8..c15565c23 100644 --- a/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart +++ b/lib/pages/wallet_view/transaction_views/transaction_search_filter_view.dart @@ -9,12 +9,12 @@ import 'package:stackwallet/models/transaction_filter.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/providers/ui/transaction_filter_provider.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/format.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; +import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/custom_buttons/app_bar_icon_button.dart'; import 'package:stackwallet/widgets/icon_widgets/x_icon.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -90,8 +90,9 @@ class _TransactionSearchViewState return Text( isDateSelected ? "From..." : _fromDateString, style: STextStyles.fieldLabel.copyWith( - color: isDateSelected ? CFColors.gray3 : CFColors.stackAccent, - ), + color: isDateSelected + ? StackTheme.instance.color.textSubtitle2 + : StackTheme.instance.color.accentColorDark), ); } @@ -100,8 +101,9 @@ class _TransactionSearchViewState return Text( isDateSelected ? "To..." : _toDateString, style: STextStyles.fieldLabel.copyWith( - color: isDateSelected ? CFColors.gray3 : CFColors.stackAccent, - ), + color: isDateSelected + ? StackTheme.instance.color.textSubtitle2 + : StackTheme.instance.color.accentColorDark), ); } @@ -109,7 +111,7 @@ class _TransactionSearchViewState var _selectedToDate = DateTime.now(); final _datePickerTextStyleBase = GoogleFonts.inter( - color: CFColors.gray3, + color: StackTheme.instance.color.textSubtitle2, fontSize: 12, fontWeight: FontWeight.w400, letterSpacing: 0.5, @@ -118,34 +120,33 @@ class _TransactionSearchViewState MaterialRoundedDatePickerStyle _buildDatePickerStyle() { return MaterialRoundedDatePickerStyle( paddingMonthHeader: const EdgeInsets.only(top: 11), - colorArrowNext: CFColors.neutral60, - colorArrowPrevious: CFColors.neutral60, + colorArrowNext: StackTheme.instance.color.textSubtitle1, + colorArrowPrevious: StackTheme.instance.color.textSubtitle1, textStyleButtonNegative: _datePickerTextStyleBase.copyWith( fontSize: 16, fontWeight: FontWeight.w600), textStyleButtonPositive: _datePickerTextStyleBase.copyWith( fontSize: 16, fontWeight: FontWeight.w600), textStyleCurrentDayOnCalendar: _datePickerTextStyleBase.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme.instance.color.accentColorDark), textStyleDayHeader: _datePickerTextStyleBase.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, fontSize: 16, fontWeight: FontWeight.w600, ), textStyleDayOnCalendar: _datePickerTextStyleBase, textStyleDayOnCalendarDisabled: _datePickerTextStyleBase.copyWith( - color: CFColors.neutral80, + color: StackTheme.instance.color.textSubtitle3, ), textStyleDayOnCalendarSelected: _datePickerTextStyleBase.copyWith( - color: CFColors.white, + color: StackTheme.instance.color.textWhite, ), textStyleMonthYearHeader: _datePickerTextStyleBase.copyWith( - color: CFColors.neutral60, + color: StackTheme.instance.color.textSubtitle1, fontSize: 16, fontWeight: FontWeight.w600, ), textStyleYearButton: _datePickerTextStyleBase.copyWith( - color: CFColors.white, + color: StackTheme.instance.color.textWhite, fontSize: 16, fontWeight: FontWeight.w600, ), @@ -156,12 +157,12 @@ class _TransactionSearchViewState MaterialRoundedYearPickerStyle _buildYearPickerStyle() { return MaterialRoundedYearPickerStyle( textStyleYear: _datePickerTextStyleBase.copyWith( - color: CFColors.gray3, + color: StackTheme.instance.color.textSubtitle2, fontWeight: FontWeight.w600, fontSize: 16, ), textStyleYearSelected: _datePickerTextStyleBase.copyWith( - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, fontWeight: FontWeight.w600, fontSize: 18, ), @@ -197,8 +198,9 @@ class _TransactionSearchViewState initialDate: DateTime.now(), height: height * 0.5, theme: ThemeData( - primarySwatch: - CFColors.createMaterialColor(CFColors.stackAccent), + primarySwatch: Util.createMaterialColor( + StackTheme.instance.color.accentColorDark, + ), ), //TODO pick a better initial date // 2007 chosen as that is just before bitcoin launched @@ -248,7 +250,7 @@ class _TransactionSearchViewState Assets.svg.calendar, height: 20, width: 20, - color: CFColors.gray3, + color: StackTheme.instance.color.textSubtitle2, ), const SizedBox( width: 10, @@ -289,8 +291,9 @@ class _TransactionSearchViewState context: context, height: height * 0.5, theme: ThemeData( - primarySwatch: - CFColors.createMaterialColor(CFColors.stackAccent), + primarySwatch: Util.createMaterialColor( + StackTheme.instance.color.accentColorDark, + ), ), //TODO pick a better initial date // 2007 chosen as that is just before bitcoin launched @@ -341,7 +344,7 @@ class _TransactionSearchViewState Assets.svg.calendar, height: 20, width: 20, - color: CFColors.gray3, + color: StackTheme.instance.color.textSubtitle2, ), const SizedBox( width: 10, @@ -679,8 +682,8 @@ class _TransactionSearchViewState child: Text( "Cancel", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme + .instance.color.accentColorDark), ), ), ), @@ -698,8 +701,8 @@ class _TransactionSearchViewState ?.copyWith( backgroundColor: MaterialStateProperty.all( - CFColors.stackAccent, - ), + StackTheme.instance.color + .accentColorDark), ), onPressed: () async { _onApplyPressed(); diff --git a/lib/pages/wallet_view/wallet_view.dart b/lib/pages/wallet_view/wallet_view.dart index 910bfc2ab..bba39f014 100644 --- a/lib/pages/wallet_view/wallet_view.dart +++ b/lib/pages/wallet_view/wallet_view.dart @@ -33,7 +33,6 @@ import 'package:stackwallet/services/event_bus/events/global/node_connection_sta import 'package:stackwallet/services/event_bus/events/global/wallet_sync_status_changed_event.dart'; import 'package:stackwallet/services/event_bus/global_event_bus.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/backup_frequency_type.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -376,7 +375,7 @@ class _WalletViewState extends ConsumerState { children: [ SvgPicture.asset( Assets.svg.iconFor(coin: coin), - // color: CFColors.stackAccent, + // color: StackTheme.instance.color.accentColorDark width: 24, height: 24, ), @@ -492,7 +491,7 @@ class _WalletViewState extends ConsumerState { color: StackTheme.instance.color.background, icon: SvgPicture.asset( Assets.svg.bars, - color: CFColors.stackAccent, + color: StackTheme.instance.color.accentColorDark, width: 20, height: 20, ), @@ -559,8 +558,8 @@ class _WalletViewState extends ConsumerState { child: Text( "Cancel", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme + .instance.color.accentColorDark), ), ), rightButton: TextButton( @@ -575,8 +574,8 @@ class _WalletViewState extends ConsumerState { ?.copyWith( backgroundColor: MaterialStateProperty.all( - CFColors.stackAccent, - ), + StackTheme.instance.color + .accentColorDark), ), child: Text( "Continue", @@ -589,8 +588,8 @@ class _WalletViewState extends ConsumerState { child: Text( "Anonymize funds", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme + .instance.color.accentColorDark), ), ), ), @@ -608,7 +607,7 @@ class _WalletViewState extends ConsumerState { Text( "Transactions", style: STextStyles.itemSubtitle.copyWith( - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, ), ), BlueTextButton( diff --git a/lib/pages/wallets_sheet/wallets_sheet.dart b/lib/pages/wallets_sheet/wallets_sheet.dart index eaecf4373..113184a2a 100644 --- a/lib/pages/wallets_sheet/wallets_sheet.dart +++ b/lib/pages/wallets_sheet/wallets_sheet.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/text_styles.dart'; @@ -24,9 +23,9 @@ class WalletsSheet extends ConsumerWidget { final maxHeight = MediaQuery.of(context).size.height * 0.60; return Container( - decoration: const BoxDecoration( - color: CFColors.white, - borderRadius: BorderRadius.vertical( + decoration: BoxDecoration( + color: StackTheme.instance.color.popupBG, + borderRadius: const BorderRadius.vertical( top: Radius.circular(20), ), ), diff --git a/lib/pages/wallets_view/sub_widgets/empty_wallets.dart b/lib/pages/wallets_view/sub_widgets/empty_wallets.dart index f95c76dea..225428053 100644 --- a/lib/pages/wallets_view/sub_widgets/empty_wallets.dart +++ b/lib/pages/wallets_view/sub_widgets/empty_wallets.dart @@ -44,10 +44,10 @@ class EmptyWallets extends StatelessWidget { textAlign: TextAlign.center, style: isDesktop ? STextStyles.desktopSubtitleH2.copyWith( - color: CFColors.textSubtitle1, + color: StackTheme.instance.color.textSubtitle1, ) : STextStyles.subtitle.copyWith( - color: CFColors.neutral60, + color: StackTheme.instance.color.textSubtitle1, ), ), SizedBox( diff --git a/lib/pages/wallets_view/sub_widgets/favorite_card.dart b/lib/pages/wallets_view/sub_widgets/favorite_card.dart index 09e9d796d..5a809548b 100644 --- a/lib/pages/wallets_view/sub_widgets/favorite_card.dart +++ b/lib/pages/wallets_view/sub_widgets/favorite_card.dart @@ -6,12 +6,11 @@ import 'package:stackwallet/pages/wallet_view/wallet_view.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/services/coins/manager.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/format.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:tuple/tuple.dart'; class FavoriteCard extends ConsumerStatefulWidget { @@ -71,7 +70,7 @@ class _FavoriteCardState extends ConsumerState { width: widget.width, height: widget.height, decoration: BoxDecoration( - color: CFColors.coin.forCoin(coin), + color: StackTheme.instance.colorForCoin(coin), borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), diff --git a/lib/pages/wallets_view/sub_widgets/favorite_wallets.dart b/lib/pages/wallets_view/sub_widgets/favorite_wallets.dart index 5c91a98ec..32dca13b8 100644 --- a/lib/pages/wallets_view/sub_widgets/favorite_wallets.dart +++ b/lib/pages/wallets_view/sub_widgets/favorite_wallets.dart @@ -123,7 +123,7 @@ class _FavoriteWalletsState extends ConsumerState { Constants.size.circularBorderRadius), ), child: MaterialButton( - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, key: const Key("favoriteWalletsAddFavoriteButtonKey"), padding: const EdgeInsets.all(12), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, @@ -142,7 +142,7 @@ class _FavoriteWalletsState extends ConsumerState { Assets.svg.plus, width: 8, height: 8, - color: CFColors.neutral60, + color: StackTheme.instance.color.textSubtitle1, ), const SizedBox( width: 4, diff --git a/lib/pages/wallets_view/sub_widgets/wallet_list_item.dart b/lib/pages/wallets_view/sub_widgets/wallet_list_item.dart index edb594873..afe2095a6 100644 --- a/lib/pages/wallets_view/sub_widgets/wallet_list_item.dart +++ b/lib/pages/wallets_view/sub_widgets/wallet_list_item.dart @@ -32,7 +32,7 @@ class WalletListItem extends ConsumerWidget { return RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: MaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, key: Key("walletListItemButtonKey_${coin.name}"), padding: const EdgeInsets.symmetric(horizontal: 12, vertical: 13), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, diff --git a/lib/pages_desktop_specific/create_password/create_password_view.dart b/lib/pages_desktop_specific/create_password/create_password_view.dart index e6f62cad0..be6ea74e6 100644 --- a/lib/pages_desktop_specific/create_password/create_password_view.dart +++ b/lib/pages_desktop_specific/create_password/create_password_view.dart @@ -6,7 +6,6 @@ import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages_desktop_specific/home/desktop_home_view.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/flutter_secure_storage_interface.dart'; @@ -196,7 +195,8 @@ class _CreatePasswordViewState extends State { hidePassword ? Assets.svg.eye : Assets.svg.eyeSlash, - color: CFColors.neutral50, + color: StackTheme + .instance.color.textDark3, width: 24, height: 19, ), @@ -260,7 +260,8 @@ class _CreatePasswordViewState extends State { passwordFeedback, style: STextStyles.desktopTextExtraSmall.copyWith( - color: CFColors.textSubtitle1, + color: + StackTheme.instance.color.textSubtitle1, ), ) : null, @@ -340,7 +341,8 @@ class _CreatePasswordViewState extends State { passwordStrength == 1 ? StackTheme.instance.color .accentColorGreen - : CFColors.neutral50, + : StackTheme + .instance.color.textDark3, width: 24, height: 19, ), diff --git a/lib/pages_desktop_specific/home/desktop_home_view.dart b/lib/pages_desktop_specific/home/desktop_home_view.dart index 0d7afcb9a..e7bc12507 100644 --- a/lib/pages_desktop_specific/home/desktop_home_view.dart +++ b/lib/pages_desktop_specific/home/desktop_home_view.dart @@ -2,7 +2,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/pages_desktop_specific/home/desktop_menu.dart'; import 'package:stackwallet/pages_desktop_specific/home/my_stack_view/my_stack_view.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; class DesktopHomeView extends ConsumerStatefulWidget { @@ -56,7 +55,7 @@ class _DesktopHomeViewState extends ConsumerState { @override Widget build(BuildContext context) { return Material( - color: CFColors.background, + color: StackTheme.instance.color.background, child: Row( children: [ DesktopMenu( diff --git a/lib/pages_desktop_specific/home/desktop_menu.dart b/lib/pages_desktop_specific/home/desktop_menu.dart index 690b2ec4e..32b526e30 100644 --- a/lib/pages_desktop_specific/home/desktop_menu.dart +++ b/lib/pages_desktop_specific/home/desktop_menu.dart @@ -3,9 +3,8 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:stackwallet/pages_desktop_specific/home/desktop_menu_item.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; class DesktopMenu extends ConsumerStatefulWidget { const DesktopMenu({ @@ -42,7 +41,7 @@ class _DesktopMenuState extends ConsumerState { @override Widget build(BuildContext context) { return Material( - color: CFColors.popupBackground, + color: StackTheme.instance.color.popupBG, child: SizedBox( width: _width, child: Column( diff --git a/lib/pages_desktop_specific/home/my_stack_view/coin_wallets_table.dart b/lib/pages_desktop_specific/home/my_stack_view/coin_wallets_table.dart index 5eb635bbc..5635b2544 100644 --- a/lib/pages_desktop_specific/home/my_stack_view/coin_wallets_table.dart +++ b/lib/pages_desktop_specific/home/my_stack_view/coin_wallets_table.dart @@ -1,8 +1,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/wallet_info_row/wallet_info_row.dart'; class CoinWalletsTable extends ConsumerWidget { @@ -17,7 +16,7 @@ class CoinWalletsTable extends ConsumerWidget { Widget build(BuildContext context, WidgetRef ref) { return Container( decoration: BoxDecoration( - color: CFColors.popupBackground, + color: StackTheme.instance.color.popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), diff --git a/lib/pages_desktop_specific/home/my_stack_view/wallet_summary_table.dart b/lib/pages_desktop_specific/home/my_stack_view/wallet_summary_table.dart index 1b8e1de09..3c17286f8 100644 --- a/lib/pages_desktop_specific/home/my_stack_view/wallet_summary_table.dart +++ b/lib/pages_desktop_specific/home/my_stack_view/wallet_summary_table.dart @@ -42,7 +42,7 @@ class _WalletTableState extends ConsumerState { vertical: 16, ), decoration: BoxDecoration( - color: CFColors.popupBackground, + color: StackTheme.instance.color.popupBG, borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), @@ -63,7 +63,7 @@ class _WalletTableState extends ConsumerState { Text( providersByCoin[i].key.prettyName, style: STextStyles.desktopTextExtraSmall.copyWith( - color: CFColors.textDark, + color: StackTheme.instance.color.textDark, ), ) ], @@ -76,7 +76,7 @@ class _WalletTableState extends ConsumerState { ? "${providersByCoin[i].value.length} wallet" : "${providersByCoin[i].value.length} wallets", style: STextStyles.desktopTextExtraSmall.copyWith( - color: CFColors.textSubtitle1, + color: StackTheme.instance.color.textSubtitle1, ), ), ), @@ -146,7 +146,7 @@ class TablePriceInfo extends ConsumerWidget { Text( "$priceString $currency/${coin.ticker}", style: STextStyles.desktopTextExtraSmall.copyWith( - color: CFColors.textSubtitle1, + color: StackTheme.instance.color.textSubtitle1, ), ), Text( diff --git a/lib/utilities/cfcolors.dart b/lib/utilities/cfcolors.dart index 91b72f24b..7702ad93b 100644 --- a/lib/utilities/cfcolors.dart +++ b/lib/utilities/cfcolors.dart @@ -1,185 +1,9 @@ -import 'package:flutter/material.dart'; -import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'; -import 'package:stackwallet/utilities/enums/coin_enum.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; - -class _CoinThemeColor { - const _CoinThemeColor(); - - Color get bitcoin => const Color(0xFFFCC17B); - Color get bitcoincash => const Color(0xFF7BCFB8); - Color get firo => const Color(0xFFFF897A); - Color get dogecoin => const Color(0xFFFFE079); - Color get epicCash => const Color(0xFFC5C7CB); - Color get monero => const Color(0xFFFF9E6B); - Color get namecoin => const Color(0xFF91B1E1); - Color get wownero => const Color(0xFFED80C1); - - Color forCoin(Coin coin) { - switch (coin) { - case Coin.bitcoin: - case Coin.bitcoinTestNet: - return bitcoin; - case Coin.bitcoincash: - case Coin.bitcoincashTestnet: - return bitcoincash; - case Coin.dogecoin: - case Coin.dogecoinTestNet: - return dogecoin; - case Coin.epicCash: - return epicCash; - case Coin.firo: - case Coin.firoTestNet: - return firo; - case Coin.monero: - return monero; - case Coin.namecoin: - return namecoin; - // case Coin.wownero: - // return wownero; - } - } -} - -class _ChangeNowTradeStatusColors { - const _ChangeNowTradeStatusColors(); - - Color get yellow => const Color(0xFFD3A90F); - Color get green => StackTheme.instance.color.accentColorGreen; - Color get red => StackTheme.instance.color.accentColorRed; - Color get gray => CFColors.gray3; - - Color forStatus(ChangeNowTransactionStatus status) { - switch (status) { - case ChangeNowTransactionStatus.New: - case ChangeNowTransactionStatus.Waiting: - case ChangeNowTransactionStatus.Confirming: - case ChangeNowTransactionStatus.Exchanging: - case ChangeNowTransactionStatus.Sending: - case ChangeNowTransactionStatus.Verifying: - return yellow; - case ChangeNowTransactionStatus.Finished: - return green; - case ChangeNowTransactionStatus.Failed: - return red; - case ChangeNowTransactionStatus.Refunded: - return gray; - } - } -} - abstract class CFColors { - static const coin = _CoinThemeColor(); - static const status = _ChangeNowTradeStatusColors(); + // static const Color primary = Color(0xFF0052DF); + // static const Color primaryLight = Color(0xFFDAE2FF); + // + // + // // generic + // static const Color white = Color(0xFFFFFFFF); - static const Color splashLight = Color(0x44A9ACAC); - static const Color splashMed = Color(0x358E9192); - static const Color splashDark = Color(0x33232323); - - static const Color selected = Color(0xFFF9F9FC); - static const Color selected2 = Color(0xFFE0E3E3); - - static const Color primary = Color(0xFF0052DF); - static const Color primaryLight = Color(0xFFDAE2FF); - - // static const Color link = Color(0xFFC00205); - static const Color link2 = Color(0xFF0056D2); - - static const Color warningBackground = Color(0xFFFFDAD3); - - // static const Color marked = Color(0xFFF61515); - // static const Color stackGreen = Color(0xFF00A578); - // static const Color stackYellow = Color(0xFFF4C517); - // static const Color stackGreen15 = Color(0xFFD2EBE4); - // static const Color stackRed = Color(0xFFDC5673); - // static const Color sentTx = Color(0x66FE805C); - // static const Color receivedTx = Color(0x6600A578); - // static const Color stackAccent = Color(0xFF232323); - // static const Color stackAccent = Color(0xFF232323); - static const Color stackAccent = Color(0xFF232323); - static const Color black = Color(0xFF191B23); - - static const Color primaryBlue = Color(0xFF074EE8); - // static const Color notificationBlueBackground = Color(0xFFDAE2FF); - // static const Color notificationBlueForeground = Color(0xFF002A78); - // static const Color notificationGreenBackground = Color(0xFFB9E9D4); - // static const Color notificationGreenForeground = Color(0xFF006C4D); - // static const Color notificationRedBackground = Color(0xFFFFDAD4); - // static const Color notificationRedForeground = Color(0xFF930006); - // static const Color error = Color(0xFF930006); - - // static const Color almostWhite = Color(0xFFF7F7F7); - static const Color light1 = Color(0xFFF5F5F5); - - // static const Color disabledButton = Color(0xFFE0E3E3); - - static const Color neutral80 = Color(0xFFC5C6C9); - static const Color neutral60 = Color(0xFF8E9192); - static const Color neutral50 = Color(0xFF747778); - static const Color selection = Color(0xFFD9E2FF); - // static const Color buttonGray = Color(0xFFE0E3E3); - - // static const Color fieldGray = Color(0xFFEEEFF1); - // static const Color textFieldActive = Color(0xFFE9EAEC); - - // static const Color contactIconBackground = Color(0xFFF4F5F8); - - static const Color gray3 = Color(0xFFA9ACAC); - // shadow - static const Color shadowColor = Color(0x0F2D3132); - static const BoxShadow standardBoxShadow = BoxShadow( - color: CFColors.shadowColor, - spreadRadius: 3, - blurRadius: 4, - ); - - // generic - static const Color white = Color(0xFFFFFFFF); - - static MaterialColor createMaterialColor(Color color) { - List strengths = [.05]; - final swatch = {}; - final int r = color.red, g = color.green, b = color.blue; - - for (int i = 1; i < 10; i++) { - strengths.add(0.1 * i); - } - for (var strength in strengths) { - final double ds = 0.5 - strength; - swatch[(strength * 1000).round()] = Color.fromRGBO( - r + ((ds < 0 ? r : (255 - r)) * ds).round(), - g + ((ds < 0 ? g : (255 - g)) * ds).round(), - b + ((ds < 0 ? b : (255 - b)) * ds).round(), - 1, - ); - } - return MaterialColor(color.value, swatch); - } - - // new - - static const Color popupBackground = Color(0xFFFFFFFF); - static const Color background = Color(0xFFF7F7F7); - - static const Color textDark = Color(0xFF232323); - static const Color textSubtitle1 = Color(0xFF8E9192); - static const Color textSubtitle2 = Color(0xFFA9ACAC); - - static const Color borderNormal = Color(0xFF111111); - - static const Color buttonTextSecondary = Color(0xFF232323); - static const Color topNavPrimary = Color(0xFF232323); - - static const Color buttonTextPrimary = Color(0xFFFFFFFF); - static const Color buttonTextPrimaryDisabled = Color(0xFFF8F8F8); - - static const Color textFieldDefaultBackground = Color(0xFFEEEFF1); - - static const Color buttonBackgroundPrimary = Color(0xFF232323); - static const Color buttonBackSecondary = Color(0xFFE0E3E3); - - static const Color buttonBackPrimaryDisabled = Color(0xFFD7D7D7); - - static const Color textFieldDefaultSearchIconLeft = Color(0xFFA9ACAC); - static const Color textFieldActiveSearchIconRight = Color(0xFF747778); } diff --git a/lib/utilities/text_styles.dart b/lib/utilities/text_styles.dart index 167ea6d23..cce566322 100644 --- a/lib/utilities/text_styles.dart +++ b/lib/utilities/text_styles.dart @@ -1,6 +1,5 @@ import 'package:flutter/material.dart'; import 'package:google_fonts/google_fonts.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; class STextStyles { @@ -47,13 +46,13 @@ class STextStyles { ); static final TextStyle smallMed14 = GoogleFonts.inter( - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, fontWeight: FontWeight.w500, fontSize: 16, ); static final TextStyle smallMed12 = GoogleFonts.inter( - color: CFColors.neutral50, + color: StackTheme.instance.color.textDark3, fontWeight: FontWeight.w500, fontSize: 14, ); @@ -65,7 +64,7 @@ class STextStyles { ); static final TextStyle itemSubtitle = GoogleFonts.inter( - color: CFColors.neutral60, + color: StackTheme.instance.color.infoItemLabel, fontWeight: FontWeight.w500, fontSize: 14, ); @@ -77,7 +76,7 @@ class STextStyles { ); static final TextStyle fieldLabel = GoogleFonts.inter( - color: CFColors.gray3, + color: StackTheme.instance.color.textSubtitle2, fontWeight: FontWeight.w500, fontSize: 14, height: 1.5, @@ -139,7 +138,7 @@ class STextStyles { ); static final TextStyle infoSmall = GoogleFonts.inter( - color: CFColors.neutral60, + color: StackTheme.instance.color.textSubtitle1, fontWeight: FontWeight.w500, fontSize: 10, ); @@ -189,42 +188,42 @@ class STextStyles { ); static final TextStyle desktopButtonEnabled = GoogleFonts.inter( - color: CFColors.buttonTextPrimary, + color: StackTheme.instance.color.buttonTextPrimary, fontWeight: FontWeight.w500, fontSize: 20, height: 26 / 20, ); static final TextStyle desktopButtonDisabled = GoogleFonts.inter( - color: CFColors.buttonTextPrimaryDisabled, + color: StackTheme.instance.color.buttonTextPrimaryDisabled, fontWeight: FontWeight.w500, fontSize: 20, height: 26 / 20, ); static final TextStyle desktopButtonSecondaryEnabled = GoogleFonts.inter( - color: CFColors.buttonTextSecondary, + color: StackTheme.instance.color.buttonTextSecondary, fontWeight: FontWeight.w500, fontSize: 20, height: 26 / 20, ); static final TextStyle desktopTextExtraSmall = GoogleFonts.inter( - color: CFColors.buttonTextPrimaryDisabled, + color: StackTheme.instance.color.buttonTextPrimaryDisabled, fontWeight: FontWeight.w500, fontSize: 16, height: 24 / 16, ); static final TextStyle desktopButtonSmallSecondaryEnabled = GoogleFonts.inter( - color: CFColors.buttonTextSecondary, + color: StackTheme.instance.color.buttonTextSecondary, fontWeight: FontWeight.w500, fontSize: 16, height: 24 / 16, ); static final TextStyle desktopTextFieldLabel = GoogleFonts.inter( - color: CFColors.textSubtitle2, + color: StackTheme.instance.color.textSubtitle2, fontWeight: FontWeight.w500, fontSize: 20, height: 30 / 20, diff --git a/lib/utilities/theme/color_theme.dart b/lib/utilities/theme/color_theme.dart index 6479aefc6..15bd42c52 100644 --- a/lib/utilities/theme/color_theme.dart +++ b/lib/utilities/theme/color_theme.dart @@ -1,5 +1,7 @@ import 'dart:ui'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; + enum ThemeType { light, dark, @@ -8,6 +10,10 @@ enum ThemeType { abstract class StackColorTheme { Color get background; Color get overlay; + Color get warningBackground; + Color get splash; + Color get highlight; + Color get accentColorBlue; Color get accentColorGreen; Color get accentColorYellow; @@ -157,3 +163,41 @@ abstract class StackColorTheme { Color get stackWalletBottom; Color get bottomNavShadow; } + +class CoinThemeColor { + const CoinThemeColor(); + + Color get bitcoin => const Color(0xFFFCC17B); + Color get bitcoincash => const Color(0xFF7BCFB8); + Color get firo => const Color(0xFFFF897A); + Color get dogecoin => const Color(0xFFFFE079); + Color get epicCash => const Color(0xFFC5C7CB); + Color get monero => const Color(0xFFFF9E6B); + Color get namecoin => const Color(0xFF91B1E1); + Color get wownero => const Color(0xFFED80C1); + + Color forCoin(Coin coin) { + switch (coin) { + case Coin.bitcoin: + case Coin.bitcoinTestNet: + return bitcoin; + case Coin.bitcoincash: + case Coin.bitcoincashTestnet: + return bitcoincash; + case Coin.dogecoin: + case Coin.dogecoinTestNet: + return dogecoin; + case Coin.epicCash: + return epicCash; + case Coin.firo: + case Coin.firoTestNet: + return firo; + case Coin.monero: + return monero; + case Coin.namecoin: + return namecoin; + // case Coin.wownero: + // return wownero; + } + } +} diff --git a/lib/utilities/theme/dark_colors.dart b/lib/utilities/theme/dark_colors.dart index 87e6620b3..4d2e3f8d4 100644 --- a/lib/utilities/theme/dark_colors.dart +++ b/lib/utilities/theme/dark_colors.dart @@ -6,6 +6,12 @@ class DarkColors extends StackColorTheme { Color get background => const Color(0xFF2A2D34); @override Color get overlay => const Color(0xFF111215); + @override + Color get warningBackground => const Color(0xFFFFB4A9); + @override + Color get splash => const Color(0x358E9192); + @override + Color get highlight => const Color(0x44A9ACAC); @override Color get accentColorBlue => const Color(0xFF4C86E9); diff --git a/lib/utilities/theme/light_colors.dart b/lib/utilities/theme/light_colors.dart index e8dd7d8b0..31546ce12 100644 --- a/lib/utilities/theme/light_colors.dart +++ b/lib/utilities/theme/light_colors.dart @@ -6,6 +6,12 @@ class LightColors extends StackColorTheme { Color get background => const Color(0xFFF7F7F7); @override Color get overlay => const Color(0xFF111215); + @override + Color get warningBackground => const Color(0xFFFFDAD3); + @override + Color get splash => const Color(0x358E9192); + @override + Color get highlight => const Color(0x44A9ACAC); @override Color get accentColorBlue => const Color(0xFF4C86E9); diff --git a/lib/utilities/theme/stack_theme.dart b/lib/utilities/theme/stack_theme.dart index 54f325fb4..5aa9d96ad 100644 --- a/lib/utilities/theme/stack_theme.dart +++ b/lib/utilities/theme/stack_theme.dart @@ -1,4 +1,6 @@ import 'package:flutter/material.dart'; +import 'package:stackwallet/models/exchange/change_now/exchange_transaction_status.dart'; +import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/theme/color_theme.dart'; import 'package:stackwallet/utilities/theme/dark_colors.dart'; import 'package:stackwallet/utilities/theme/light_colors.dart'; @@ -29,6 +31,49 @@ class StackTheme { blurRadius: 4, ); + Color colorForCoin(Coin coin) { + switch (coin) { + case Coin.bitcoin: + case Coin.bitcoinTestNet: + return _coin.bitcoin; + case Coin.bitcoincash: + case Coin.bitcoincashTestnet: + return _coin.bitcoincash; + case Coin.dogecoin: + case Coin.dogecoinTestNet: + return _coin.dogecoin; + case Coin.epicCash: + return _coin.epicCash; + case Coin.firo: + case Coin.firoTestNet: + return _coin.firo; + case Coin.monero: + return _coin.monero; + case Coin.namecoin: + return _coin.namecoin; + // case Coin.wownero: + // return wownero; + } + } + + Color colorForStatus(ChangeNowTransactionStatus status) { + switch (status) { + case ChangeNowTransactionStatus.New: + case ChangeNowTransactionStatus.Waiting: + case ChangeNowTransactionStatus.Confirming: + case ChangeNowTransactionStatus.Exchanging: + case ChangeNowTransactionStatus.Sending: + case ChangeNowTransactionStatus.Verifying: + return const Color(0xFFD3A90F); + case ChangeNowTransactionStatus.Finished: + return color.accentColorGreen; + case ChangeNowTransactionStatus.Failed: + return color.accentColorRed; + case ChangeNowTransactionStatus.Refunded: + return color.textSubtitle2; + } + } + ButtonStyle? getPrimaryEnabledButtonColor(BuildContext context) => Theme.of(context).textButtonTheme.style?.copyWith( backgroundColor: MaterialStateProperty.all( @@ -70,4 +115,6 @@ class StackTheme { color.textFieldDefaultBG, ), ); + + static const _coin = CoinThemeColor(); } diff --git a/lib/utilities/util.dart b/lib/utilities/util.dart index 5e4b861d1..8a98787f2 100644 --- a/lib/utilities/util.dart +++ b/lib/utilities/util.dart @@ -1,7 +1,29 @@ import 'dart:io'; +import 'package:flutter/material.dart'; + abstract class Util { static bool get isDesktop { return Platform.isLinux || Platform.isMacOS || Platform.isWindows; } + + static MaterialColor createMaterialColor(Color color) { + List strengths = [.05]; + final swatch = {}; + final int r = color.red, g = color.green, b = color.blue; + + for (int i = 1; i < 10; i++) { + strengths.add(0.1 * i); + } + for (var strength in strengths) { + final double ds = 0.5 - strength; + swatch[(strength * 1000).round()] = Color.fromRGBO( + r + ((ds < 0 ? r : (255 - r)) * ds).round(), + g + ((ds < 0 ? g : (255 - g)) * ds).round(), + b + ((ds < 0 ? b : (255 - b)) * ds).round(), + 1, + ); + } + return MaterialColor(color.value, swatch); + } } diff --git a/lib/widgets/address_book_card.dart b/lib/widgets/address_book_card.dart index c3b26a744..c310d786a 100644 --- a/lib/widgets/address_book_card.dart +++ b/lib/widgets/address_book_card.dart @@ -54,7 +54,7 @@ class _AddressBookCardState extends ConsumerState { return RoundedWhiteContainer( padding: const EdgeInsets.all(4), child: RawMaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, padding: const EdgeInsets.all(0), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( diff --git a/lib/widgets/custom_buttons/app_bar_icon_button.dart b/lib/widgets/custom_buttons/app_bar_icon_button.dart index 806e19add..ade559962 100644 --- a/lib/widgets/custom_buttons/app_bar_icon_button.dart +++ b/lib/widgets/custom_buttons/app_bar_icon_button.dart @@ -34,7 +34,7 @@ class AppBarIconButton extends StatelessWidget { boxShadow: shadows, ), child: MaterialButton( - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, padding: EdgeInsets.zero, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( diff --git a/lib/widgets/custom_buttons/draggable_switch_button.dart b/lib/widgets/custom_buttons/draggable_switch_button.dart index 62fb8c78b..06fe08e5b 100644 --- a/lib/widgets/custom_buttons/draggable_switch_button.dart +++ b/lib/widgets/custom_buttons/draggable_switch_button.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; class DraggableSwitchButton extends StatefulWidget { @@ -38,21 +37,21 @@ class DraggableSwitchButtonState extends State { Color _colorBG(bool isOn, bool enabled, double alpha) { if (enabled) { return Color.alphaBlend( - CFColors.primary.withOpacity(alpha), - CFColors.primaryLight, + StackTheme.instance.color.switchBGOn.withOpacity(alpha), + StackTheme.instance.color.switchBGOff, ); } - return CFColors.neutral80; + return StackTheme.instance.color.switchBGDisabled; } Color _colorFG(bool isOn, bool enabled, double alpha) { if (enabled) { return Color.alphaBlend( - CFColors.primaryLight.withOpacity(alpha), - CFColors.white, + StackTheme.instance.color.switchCircleOn.withOpacity(alpha), + StackTheme.instance.color.switchCircleOff, ); } - return CFColors.white; + return StackTheme.instance.color.switchCircleDisabled; } @override diff --git a/lib/widgets/custom_buttons/favorite_toggle.dart b/lib/widgets/custom_buttons/favorite_toggle.dart index 5647eb0ec..6869a7fe1 100644 --- a/lib/widgets/custom_buttons/favorite_toggle.dart +++ b/lib/widgets/custom_buttons/favorite_toggle.dart @@ -52,7 +52,7 @@ class _FavoriteToggleState extends State { borderRadius: widget.borderRadius, ), child: MaterialButton( - splashColor: CFColors.splashLight, + splashColor: StackTheme.instance.color.highlight, minWidth: 0, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: RoundedRectangleBorder( diff --git a/lib/widgets/custom_loading_overlay.dart b/lib/widgets/custom_loading_overlay.dart index 8af4c02dc..a11832207 100644 --- a/lib/widgets/custom_loading_overlay.dart +++ b/lib/widgets/custom_loading_overlay.dart @@ -3,9 +3,8 @@ import 'dart:async'; import 'package:event_bus/event_bus.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/loading_indicator.dart'; class CustomLoadingOverlay extends ConsumerStatefulWidget { @@ -58,7 +57,7 @@ class _CustomLoadingOverlayState extends ConsumerState { Text( widget.message, style: STextStyles.pageTitleH2.copyWith( - color: CFColors.white, + color: StackTheme.instance.color.accentColorOrange, ), ), if (widget.eventBus != null) @@ -69,7 +68,7 @@ class _CustomLoadingOverlayState extends ConsumerState { Text( "${(_percent * 100).toStringAsFixed(2)}%", style: STextStyles.pageTitleH2.copyWith( - color: CFColors.white, + color: StackTheme.instance.color.accentColorOrange, ), ), ], diff --git a/lib/widgets/custom_pin_put/pin_keyboard.dart b/lib/widgets/custom_pin_put/pin_keyboard.dart index 1218d2ae2..45f127669 100644 --- a/lib/widgets/custom_pin_put/pin_keyboard.dart +++ b/lib/widgets/custom_pin_put/pin_keyboard.dart @@ -45,7 +45,7 @@ class _NumberKeyState extends State { shadows: const [], ), child: MaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: const StadiumBorder(), onPressed: () async { @@ -114,7 +114,7 @@ class _BackspaceKeyState extends State { shadows: const [], ), child: MaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: const StadiumBorder(), onPressed: () { @@ -164,7 +164,7 @@ class SubmitKey extends StatelessWidget { shadows: const [], ), child: MaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, shape: const StadiumBorder(), onPressed: () { diff --git a/lib/widgets/desktop/desktop_scaffold.dart b/lib/widgets/desktop/desktop_scaffold.dart index 2fd36c239..697ce8030 100644 --- a/lib/widgets/desktop/desktop_scaffold.dart +++ b/lib/widgets/desktop/desktop_scaffold.dart @@ -1,23 +1,22 @@ import 'package:flutter/material.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; class DesktopScaffold extends StatelessWidget { const DesktopScaffold({ Key? key, - this.background = CFColors.background, + this.background, this.appBar, this.body, }) : super(key: key); - final Color background; + final Color? background; final Widget? appBar; final Widget? body; @override Widget build(BuildContext context) { return Material( - color: background, + color: background ?? StackTheme.instance.color.background, child: Column( // crossAxisAlignment: CrossAxisAlignment.stretch, children: [ @@ -38,25 +37,25 @@ class MasterScaffold extends StatelessWidget { required this.isDesktop, required this.appBar, required this.body, - this.background = CFColors.background, + this.background, }) : super(key: key); final bool isDesktop; final Widget appBar; final Widget body; - final Color background; + final Color? background; @override Widget build(BuildContext context) { if (isDesktop) { return DesktopScaffold( - background: background, + background: background ?? StackTheme.instance.color.background, appBar: appBar, body: body, ); } else { return Scaffold( - backgroundColor: background, + backgroundColor: background ?? StackTheme.instance.color.background, appBar: appBar as PreferredSizeWidget?, body: body, ); diff --git a/lib/widgets/emoji_select_sheet.dart b/lib/widgets/emoji_select_sheet.dart index 67405f68d..879ca0de7 100644 --- a/lib/widgets/emoji_select_sheet.dart +++ b/lib/widgets/emoji_select_sheet.dart @@ -1,7 +1,6 @@ import 'package:emojis/emoji.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/text_styles.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; @@ -26,9 +25,9 @@ class EmojiSelectSheet extends ConsumerWidget { final itemCount = Emoji.all().length; return Container( - decoration: const BoxDecoration( - color: CFColors.white, - borderRadius: BorderRadius.vertical( + decoration: BoxDecoration( + color: StackTheme.instance.color.popupBG, + borderRadius: const BorderRadius.vertical( top: Radius.circular(20), ), ), diff --git a/lib/widgets/icon_widgets/addressbook_icon.dart b/lib/widgets/icon_widgets/addressbook_icon.dart index 60cd9e01b..e6b0fb8d2 100644 --- a/lib/widgets/icon_widgets/addressbook_icon.dart +++ b/lib/widgets/icon_widgets/addressbook_icon.dart @@ -9,7 +9,7 @@ class AddressBookIcon extends StatelessWidget { Key? key, this.width = 16, this.height = 16, - this.color = CFColors.neutral50, + this.color, }) : super(key: key); final double width; @@ -22,7 +22,7 @@ class AddressBookIcon extends StatelessWidget { Assets.svg.addressBook, width: width, height: height, - color: color, + color: color ?? StackTheme.instance.color.textDark3, ); } } diff --git a/lib/widgets/icon_widgets/clipboard_icon.dart b/lib/widgets/icon_widgets/clipboard_icon.dart index cd64cdaa6..7dd720190 100644 --- a/lib/widgets/icon_widgets/clipboard_icon.dart +++ b/lib/widgets/icon_widgets/clipboard_icon.dart @@ -1,7 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; class ClipboardIcon extends StatelessWidget { @@ -9,7 +8,7 @@ class ClipboardIcon extends StatelessWidget { Key? key, this.width = 18, this.height = 18, - this.color = CFColors.neutral50, + this.color, }) : super(key: key); final double width; @@ -22,7 +21,7 @@ class ClipboardIcon extends StatelessWidget { Assets.svg.clipboard, width: width, height: height, - color: color, + color: color ?? StackTheme.instance.color.textDark3, ); } } diff --git a/lib/widgets/icon_widgets/dice_icon.dart b/lib/widgets/icon_widgets/dice_icon.dart index 7eecdeffb..9343108d3 100644 --- a/lib/widgets/icon_widgets/dice_icon.dart +++ b/lib/widgets/icon_widgets/dice_icon.dart @@ -1,7 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; class DiceIcon extends StatelessWidget { @@ -9,7 +8,7 @@ class DiceIcon extends StatelessWidget { Key? key, this.width = 17, this.height = 17, - this.color = CFColors.neutral50, + this.color, }) : super(key: key); final double width; @@ -22,7 +21,7 @@ class DiceIcon extends StatelessWidget { Assets.svg.dice, width: width, height: height, - color: color, + color: color ?? StackTheme.instance.color.textDark3, ); } } diff --git a/lib/widgets/icon_widgets/qrcode_icon.dart b/lib/widgets/icon_widgets/qrcode_icon.dart index 0af83729f..3dc44f8d7 100644 --- a/lib/widgets/icon_widgets/qrcode_icon.dart +++ b/lib/widgets/icon_widgets/qrcode_icon.dart @@ -1,7 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; class QrCodeIcon extends StatelessWidget { @@ -9,7 +8,7 @@ class QrCodeIcon extends StatelessWidget { Key? key, this.width = 17, this.height = 17, - this.color = CFColors.neutral50, + this.color, }) : super(key: key); final double width; @@ -22,7 +21,7 @@ class QrCodeIcon extends StatelessWidget { Assets.svg.qrcode, width: width, height: height, - color: color, + color: color ?? StackTheme.instance.color.textDark3, ); } } diff --git a/lib/widgets/icon_widgets/x_icon.dart b/lib/widgets/icon_widgets/x_icon.dart index cbf67647d..d4a5baac8 100644 --- a/lib/widgets/icon_widgets/x_icon.dart +++ b/lib/widgets/icon_widgets/x_icon.dart @@ -1,7 +1,6 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; class XIcon extends StatelessWidget { @@ -9,7 +8,7 @@ class XIcon extends StatelessWidget { Key? key, this.width = 18, this.height = 18, - this.color = CFColors.neutral50, + this.color, }) : super(key: key); final double width; @@ -22,7 +21,7 @@ class XIcon extends StatelessWidget { Assets.svg.x, width: width, height: height, - color: color, + color: color ?? StackTheme.instance.color.textFieldActiveSearchIconRight, ); } } diff --git a/lib/widgets/managed_favorite.dart b/lib/widgets/managed_favorite.dart index 36d40a1b0..5f0faa568 100644 --- a/lib/widgets/managed_favorite.dart +++ b/lib/widgets/managed_favorite.dart @@ -3,12 +3,11 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/format.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/custom_buttons/favorite_toggle.dart'; import 'package:stackwallet/widgets/rounded_white_container.dart'; @@ -41,13 +40,13 @@ class _ManagedFavoriteCardState extends ConsumerState { if (!manager.isFavorite) { ref.read(favoritesProvider).add(provider, true); ref.read(nonFavoritesProvider).remove(provider, true); - ref + await ref .read(walletsServiceChangeNotifierProvider) .addFavorite(manager.walletId); } else { ref.read(favoritesProvider).remove(provider, true); ref.read(nonFavoritesProvider).add(provider, true); - ref + await ref .read(walletsServiceChangeNotifierProvider) .removeFavorite(manager.walletId); } @@ -65,7 +64,9 @@ class _ManagedFavoriteCardState extends ConsumerState { children: [ Container( decoration: BoxDecoration( - color: CFColors.coin.forCoin(manager.coin).withOpacity(0.5), + color: StackTheme.instance + .colorForCoin(manager.coin) + .withOpacity(0.5), borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), diff --git a/lib/widgets/node_options_sheet.dart b/lib/widgets/node_options_sheet.dart index 3a3f86c9d..303ce02b6 100644 --- a/lib/widgets/node_options_sheet.dart +++ b/lib/widgets/node_options_sheet.dart @@ -1,3 +1,5 @@ +import 'dart:async'; + import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; @@ -7,7 +9,6 @@ import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/settings_views/global_settings_view/manage_nodes_views/node_details_view.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/default_nodes.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; @@ -105,6 +106,9 @@ class NodeOptionsSheet extends ConsumerWidget { case Coin.bitcoinTestNet: case Coin.firoTestNet: case Coin.dogecoinTestNet: + case Coin.bitcoincash: + case Coin.namecoin: + case Coin.bitcoincashTestnet: final client = ElectrumX( host: node.host, port: node.port, @@ -129,12 +133,12 @@ class NodeOptionsSheet extends ConsumerWidget { // context: context, // ); } else { - showFloatingFlushBar( + unawaited(showFloatingFlushBar( type: FlushBarType.warning, iconAsset: Assets.svg.circleAlert, message: "Could not connect to node", context: context, - ); + )); } return testPassed; @@ -155,9 +159,9 @@ class NodeOptionsSheet extends ConsumerWidget { : "Connected"; return Container( - decoration: const BoxDecoration( - color: CFColors.white, - borderRadius: BorderRadius.vertical( + decoration: BoxDecoration( + color: StackTheme.instance.color.popupBG, + borderRadius: const BorderRadius.vertical( top: Radius.circular(20), ), ), @@ -271,8 +275,7 @@ class NodeOptionsSheet extends ConsumerWidget { child: Text( "Details", style: STextStyles.button.copyWith( - color: CFColors.stackAccent, - ), + color: StackTheme.instance.color.accentColorDark), ), ), ), @@ -296,7 +299,7 @@ class NodeOptionsSheet extends ConsumerWidget { return; } - ref + await ref .read(nodeServiceChangeNotifierProvider) .setPrimaryNodeFor( coin: coin, @@ -304,7 +307,7 @@ class NodeOptionsSheet extends ConsumerWidget { shouldNotifyListeners: true, ); - _notifyWalletsOfUpdatedNode(ref); + await _notifyWalletsOfUpdatedNode(ref); }, child: Text( // status == "Connected" ? "Disconnect" : "Connect", diff --git a/lib/widgets/rounded_white_container.dart b/lib/widgets/rounded_white_container.dart index 8ce3d7376..c612ce68d 100644 --- a/lib/widgets/rounded_white_container.dart +++ b/lib/widgets/rounded_white_container.dart @@ -1,5 +1,4 @@ import 'package:flutter/cupertino.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/rounded_container.dart'; @@ -22,7 +21,7 @@ class RoundedWhiteContainer extends StatelessWidget { @override Widget build(BuildContext context) { return RoundedContainer( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, padding: padding, radiusMultiplier: radiusMultiplier, width: width, diff --git a/lib/widgets/stack_dialog.dart b/lib/widgets/stack_dialog.dart index 1fc05de69..8dc108c8e 100644 --- a/lib/widgets/stack_dialog.dart +++ b/lib/widgets/stack_dialog.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; class StackDialogBase extends StatelessWidget { const StackDialogBase({ @@ -26,7 +25,7 @@ class StackDialogBase extends StatelessWidget { ), child: Container( decoration: BoxDecoration( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, borderRadius: BorderRadius.circular( 20, ), @@ -184,10 +183,11 @@ class StackOkDialog extends StatelessWidget { Navigator.of(context).pop(); onOkPressed?.call("OK"); }, + style: + StackTheme.instance.getPrimaryEnabledButtonColor(context), child: Text( "Ok", - style: STextStyles.button - .copyWith(color: CFColors.stackAccent), + style: STextStyles.button, ), ), ), diff --git a/lib/widgets/table_view/table_view_row.dart b/lib/widgets/table_view/table_view_row.dart index 862ae3e86..95b5ed706 100644 --- a/lib/widgets/table_view/table_view_row.dart +++ b/lib/widgets/table_view/table_view_row.dart @@ -1,5 +1,4 @@ import 'package:flutter/material.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/widgets/expandable.dart'; import 'package:stackwallet/widgets/table_view/table_view_cell.dart'; @@ -56,7 +55,7 @@ class TableViewRow extends StatelessWidget { body: Column( children: [ Container( - color: CFColors.buttonBackSecondary, + color: StackTheme.instance.color.buttonBackSecondary, width: double.infinity, height: 1, ), diff --git a/lib/widgets/transaction_card.dart b/lib/widgets/transaction_card.dart index 6aa693373..705fda2eb 100644 --- a/lib/widgets/transaction_card.dart +++ b/lib/widgets/transaction_card.dart @@ -7,13 +7,12 @@ import 'package:stackwallet/notifications/show_flush_bar.dart'; import 'package:stackwallet/pages/wallet_view/sub_widgets/tx_icon.dart'; import 'package:stackwallet/pages/wallet_view/transaction_views/transaction_details_view.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/enums/flush_bar_type.dart'; import 'package:stackwallet/utilities/format.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:tuple/tuple.dart'; class TransactionCard extends ConsumerStatefulWidget { @@ -102,7 +101,7 @@ class _TransactionCardState extends ConsumerState { .item1; return Material( - color: CFColors.white, + color: StackTheme.instance.color.popupBG, elevation: 0, shape: RoundedRectangleBorder( borderRadius: diff --git a/lib/widgets/wallet_card.dart b/lib/widgets/wallet_card.dart index 31bba62a0..9a47d0489 100644 --- a/lib/widgets/wallet_card.dart +++ b/lib/widgets/wallet_card.dart @@ -22,7 +22,7 @@ class WalletSheetCard extends ConsumerWidget { return RoundedWhiteContainer( padding: const EdgeInsets.all(0), child: MaterialButton( - // splashColor: CFColors.splashLight, + // splashColor: StackTheme.instance.color.highlight, key: Key("walletsSheetItemButtonKey_$walletId"), padding: const EdgeInsets.all(5), materialTapTargetSize: MaterialTapTargetSize.shrinkWrap, diff --git a/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance_future.dart b/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance_future.dart index b07f51dd7..1a8078874 100644 --- a/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance_future.dart +++ b/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance_future.dart @@ -2,11 +2,10 @@ import 'package:decimal/decimal.dart'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:stackwallet/providers/providers.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; import 'package:stackwallet/utilities/format.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/animated_text.dart'; @@ -41,7 +40,7 @@ class WalletInfoRowBalanceFuture extends ConsumerWidget { )} ${manager.coin.ticker}", style: Util.isDesktop ? STextStyles.desktopTextExtraSmall.copyWith( - color: CFColors.textSubtitle1, + color: StackTheme.instance.color.textSubtitle1, ) : STextStyles.itemSubtitle, ); @@ -55,7 +54,7 @@ class WalletInfoRowBalanceFuture extends ConsumerWidget { ], style: Util.isDesktop ? STextStyles.desktopTextExtraSmall.copyWith( - color: CFColors.textSubtitle1, + color: StackTheme.instance.color.textSubtitle1, ) : STextStyles.itemSubtitle, ); diff --git a/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart b/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart index 207708fd8..09e497aac 100644 --- a/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart +++ b/lib/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart @@ -1,10 +1,9 @@ import 'package:flutter/material.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/constants.dart'; import 'package:stackwallet/utilities/enums/coin_enum.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; class WalletInfoCoinIcon extends StatelessWidget { const WalletInfoCoinIcon({Key? key, required this.coin}) : super(key: key); @@ -15,7 +14,7 @@ class WalletInfoCoinIcon extends StatelessWidget { Widget build(BuildContext context) { return Container( decoration: BoxDecoration( - color: CFColors.coin.forCoin(coin).withOpacity(0.5), + color: StackTheme.instance.colorForCoin(coin).withOpacity(0.5), borderRadius: BorderRadius.circular( Constants.size.circularBorderRadius, ), diff --git a/lib/widgets/wallet_info_row/wallet_info_row.dart b/lib/widgets/wallet_info_row/wallet_info_row.dart index c8d047cc7..be97811d3 100644 --- a/lib/widgets/wallet_info_row/wallet_info_row.dart +++ b/lib/widgets/wallet_info_row/wallet_info_row.dart @@ -3,9 +3,8 @@ import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_svg/svg.dart'; import 'package:stackwallet/providers/providers.dart'; import 'package:stackwallet/utilities/assets.dart'; -import 'package:stackwallet/utilities/cfcolors.dart'; -import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/text_styles.dart'; +import 'package:stackwallet/utilities/theme/stack_theme.dart'; import 'package:stackwallet/utilities/util.dart'; import 'package:stackwallet/widgets/wallet_info_row/sub_widgets/wallet_info_row_balance_future.dart'; import 'package:stackwallet/widgets/wallet_info_row/sub_widgets/wallet_info_row_coin_icon.dart'; @@ -40,7 +39,7 @@ class WalletInfoRow extends ConsumerWidget { Text( manager.walletName, style: STextStyles.desktopTextExtraSmall.copyWith( - color: CFColors.topNavPrimary, + color: StackTheme.instance.color.textDark, ), ), ], @@ -61,7 +60,7 @@ class WalletInfoRow extends ConsumerWidget { Assets.svg.chevronRight, width: 20, height: 20, - color: CFColors.textSubtitle1, + color: StackTheme.instance.color.textSubtitle1, ) ], ),