From c656da6decee60c217fd4f04a31dacbb4b8222ec Mon Sep 17 00:00:00 2001 From: julian <julian@cypherstack.com> Date: Sat, 24 Sep 2022 15:52:03 -0600 Subject: [PATCH] style fixes --- .../restore_options_view.dart | 59 +++++++++++------ .../exchange_step_views/step_4_view.dart | 4 +- lib/pages/exchange_view/exchange_view.dart | 10 +++ .../exchange_view/trade_details_view.dart | 4 +- .../wallet_initiated_exchange_view.dart | 13 ++++ lib/pages/send_view/send_view.dart | 8 +-- .../transaction_search_filter_view.dart | 63 ++++++++++++------- lib/utilities/text_styles.dart | 19 ++++++ lib/widgets/transaction_card.dart | 6 +- 9 files changed, 132 insertions(+), 54 deletions(-) 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 5df7fd81d..ffa10afc4 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 @@ -73,43 +73,62 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> { super.dispose(); } - TextStyle get _datePickerTextStyleBase => GoogleFonts.inter( - color: baseColor, - fontSize: 12, - fontWeight: FontWeight.w400, - letterSpacing: 0.5, - ); MaterialRoundedDatePickerStyle _buildDatePickerStyle() { return MaterialRoundedDatePickerStyle( paddingMonthHeader: const EdgeInsets.only(top: 11), colorArrowNext: Theme.of(context).extension<StackColors>()!.textSubtitle1, colorArrowPrevious: Theme.of(context).extension<StackColors>()!.textSubtitle1, - textStyleButtonNegative: _datePickerTextStyleBase.copyWith( - fontSize: 16, fontWeight: FontWeight.w600), - textStyleButtonPositive: _datePickerTextStyleBase.copyWith( - fontSize: 16, fontWeight: FontWeight.w600), - textStyleCurrentDayOnCalendar: _datePickerTextStyleBase.copyWith( + textStyleButtonNegative: GoogleFonts.inter( + color: baseColor, + letterSpacing: 0.5, + fontSize: 16, + fontWeight: FontWeight.w600, + ), + textStyleButtonPositive: GoogleFonts.inter( + color: baseColor, + letterSpacing: 0.5, + fontSize: 16, + fontWeight: FontWeight.w600, + ), + textStyleCurrentDayOnCalendar: GoogleFonts.inter( + fontSize: 12, + fontWeight: FontWeight.w400, + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.accentColorDark, ), - textStyleDayHeader: _datePickerTextStyleBase.copyWith( + textStyleDayHeader: GoogleFonts.inter( + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.accentColorDark, fontSize: 16, fontWeight: FontWeight.w600, ), - textStyleDayOnCalendar: _datePickerTextStyleBase, - textStyleDayOnCalendarDisabled: _datePickerTextStyleBase.copyWith( + textStyleDayOnCalendar: GoogleFonts.inter( + color: baseColor, + fontSize: 12, + fontWeight: FontWeight.w400, + letterSpacing: 0.5, + ), + textStyleDayOnCalendarDisabled: GoogleFonts.inter( + fontSize: 12, + fontWeight: FontWeight.w400, + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.textSubtitle3, ), - textStyleDayOnCalendarSelected: _datePickerTextStyleBase.copyWith( + textStyleDayOnCalendarSelected: GoogleFonts.inter( + fontSize: 12, + fontWeight: FontWeight.w400, + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.popupBG, ), - textStyleMonthYearHeader: _datePickerTextStyleBase.copyWith( + textStyleMonthYearHeader: GoogleFonts.inter( + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.textSubtitle1, fontSize: 16, fontWeight: FontWeight.w600, ), - textStyleYearButton: _datePickerTextStyleBase.copyWith( + textStyleYearButton: GoogleFonts.inter( + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.textWhite, fontSize: 16, fontWeight: FontWeight.w600, @@ -120,12 +139,14 @@ class _RestoreOptionsViewState extends ConsumerState<RestoreOptionsView> { MaterialRoundedYearPickerStyle _buildYearPickerStyle() { return MaterialRoundedYearPickerStyle( - textStyleYear: _datePickerTextStyleBase.copyWith( + textStyleYear: GoogleFonts.inter( + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.textSubtitle2, fontWeight: FontWeight.w600, fontSize: 16, ), - textStyleYearSelected: _datePickerTextStyleBase.copyWith( + textStyleYearSelected: GoogleFonts.inter( + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.accentColorDark, fontWeight: FontWeight.w600, fontSize: 18, 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 4a228baab..222ccfc08 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 @@ -178,11 +178,10 @@ class _Step4ViewState extends ConsumerState<Step4View> { text: TextSpan( text: "You must send at least ${model.sendAmount.toString()} ${model.sendTicker}. ", - style: STextStyles.label(context).copyWith( + style: STextStyles.label700(context).copyWith( color: Theme.of(context) .extension<StackColors>()! .warningForeground, - fontWeight: FontWeight.w700, ), children: [ TextSpan( @@ -192,7 +191,6 @@ class _Step4ViewState extends ConsumerState<Step4View> { color: Theme.of(context) .extension<StackColors>()! .warningForeground, - fontWeight: FontWeight.w500, ), ), ], diff --git a/lib/pages/exchange_view/exchange_view.dart b/lib/pages/exchange_view/exchange_view.dart index 2f0bfe194..1487f5f6a 100644 --- a/lib/pages/exchange_view/exchange_view.dart +++ b/lib/pages/exchange_view/exchange_view.dart @@ -379,6 +379,11 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> { height: 4, ), TextFormField( + style: STextStyles.smallMed14(context).copyWith( + color: Theme.of(context) + .extension<StackColors>()! + .textDark, + ), focusNode: _sendFocusNode, controller: _sendController, textAlign: TextAlign.right, @@ -720,6 +725,11 @@ class _ExchangeViewState extends ConsumerState<ExchangeView> { height: 4, ), TextFormField( + style: STextStyles.smallMed14(context).copyWith( + color: Theme.of(context) + .extension<StackColors>()! + .textDark, + ), focusNode: _receiveFocusNode, controller: _receiveController, readOnly: ref diff --git a/lib/pages/exchange_view/trade_details_view.dart b/lib/pages/exchange_view/trade_details_view.dart index 439b0f659..6c299ed24 100644 --- a/lib/pages/exchange_view/trade_details_view.dart +++ b/lib/pages/exchange_view/trade_details_view.dart @@ -249,11 +249,10 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> { "You must send at least ${sendAmount.toStringAsFixed( trade.fromCurrency.toLowerCase() == "xmr" ? 12 : 8, )} ${trade.fromCurrency.toUpperCase()}. ", - style: STextStyles.label(context).copyWith( + style: STextStyles.label700(context).copyWith( color: Theme.of(context) .extension<StackColors>()! .warningForeground, - fontWeight: FontWeight.w700, ), children: [ TextSpan( @@ -267,7 +266,6 @@ class _TradeDetailsViewState extends ConsumerState<TradeDetailsView> { color: Theme.of(context) .extension<StackColors>()! .warningForeground, - fontWeight: FontWeight.w500, ), ), ]), diff --git a/lib/pages/exchange_view/wallet_initiated_exchange_view.dart b/lib/pages/exchange_view/wallet_initiated_exchange_view.dart index 2be98f002..179555ba6 100644 --- a/lib/pages/exchange_view/wallet_initiated_exchange_view.dart +++ b/lib/pages/exchange_view/wallet_initiated_exchange_view.dart @@ -424,6 +424,11 @@ class _WalletInitiatedExchangeViewState height: 4, ), TextFormField( + style: STextStyles.smallMed14(context).copyWith( + color: Theme.of(context) + .extension<StackColors>()! + .textDark, + ), focusNode: _sendFocusNode, controller: _sendController, textAlign: TextAlign.right, @@ -762,6 +767,9 @@ class _WalletInitiatedExchangeViewState Assets.svg.swap, width: 20, height: 20, + color: Theme.of(context) + .extension<StackColors>()! + .accentColorDark, ), ), ), @@ -788,6 +796,11 @@ class _WalletInitiatedExchangeViewState height: 4, ), TextFormField( + style: STextStyles.smallMed14(context).copyWith( + color: Theme.of(context) + .extension<StackColors>()! + .textDark, + ), focusNode: _receiveFocusNode, controller: _receiveController, readOnly: ref diff --git a/lib/pages/send_view/send_view.dart b/lib/pages/send_view/send_view.dart index f87252291..25264e19c 100644 --- a/lib/pages/send_view/send_view.dart +++ b/lib/pages/send_view/send_view.dart @@ -523,11 +523,11 @@ class _SendViewState extends ConsumerState<SendView> { locale: locale, decimalPlaces: 2, )} ${ref.watch(prefsChangeNotifierProvider.select((value) => value.currency))}", - style: STextStyles.titleBold12( - context) - .copyWith( + style: + STextStyles.titleBold12_400( + context) + .copyWith( fontSize: 8, - fontWeight: FontWeight.w400, ), textAlign: TextAlign.right, ) 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 5966e3f5c..48fe89e65 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 @@ -114,13 +114,6 @@ class _TransactionSearchViewState var _selectedFromDate = DateTime(2007); var _selectedToDate = DateTime.now(); - TextStyle get _datePickerTextStyleBase => GoogleFonts.inter( - color: baseColor, - fontSize: 12, - fontWeight: FontWeight.w400, - letterSpacing: 0.5, - ); - MaterialRoundedDatePickerStyle _buildDatePickerStyle() { return MaterialRoundedDatePickerStyle( backgroundPicker: Theme.of(context).extension<StackColors>()!.popupBG, @@ -129,30 +122,56 @@ class _TransactionSearchViewState colorArrowNext: Theme.of(context).extension<StackColors>()!.textSubtitle1, colorArrowPrevious: Theme.of(context).extension<StackColors>()!.textSubtitle1, - textStyleButtonNegative: _datePickerTextStyleBase.copyWith( - fontSize: 16, fontWeight: FontWeight.w600), - textStyleButtonPositive: _datePickerTextStyleBase.copyWith( - fontSize: 16, fontWeight: FontWeight.w600), - textStyleCurrentDayOnCalendar: _datePickerTextStyleBase.copyWith( - color: Theme.of(context).extension<StackColors>()!.accentColorDark), - textStyleDayHeader: _datePickerTextStyleBase.copyWith( + textStyleButtonNegative: GoogleFonts.inter( + letterSpacing: 0.5, + color: baseColor, + fontSize: 16, + fontWeight: FontWeight.w600, + ), + textStyleButtonPositive: GoogleFonts.inter( + letterSpacing: 0.5, + color: baseColor, + fontSize: 16, + fontWeight: FontWeight.w600, + ), + textStyleCurrentDayOnCalendar: GoogleFonts.inter( + letterSpacing: 0.5, + color: Theme.of(context).extension<StackColors>()!.accentColorDark, + fontWeight: FontWeight.w400, + fontSize: 12, + ), + textStyleDayHeader: GoogleFonts.inter( + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.accentColorDark, fontSize: 16, fontWeight: FontWeight.w600, ), - textStyleDayOnCalendar: _datePickerTextStyleBase, - textStyleDayOnCalendarDisabled: _datePickerTextStyleBase.copyWith( + textStyleDayOnCalendar: GoogleFonts.inter( + letterSpacing: 0.5, + color: baseColor, + fontSize: 12, + fontWeight: FontWeight.w400, + ), + textStyleDayOnCalendarDisabled: GoogleFonts.inter( + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.textSubtitle3, + fontWeight: FontWeight.w400, + fontSize: 12, ), - textStyleDayOnCalendarSelected: _datePickerTextStyleBase.copyWith( + textStyleDayOnCalendarSelected: GoogleFonts.inter( + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.textWhite, + fontWeight: FontWeight.w400, + fontSize: 12, ), - textStyleMonthYearHeader: _datePickerTextStyleBase.copyWith( + textStyleMonthYearHeader: GoogleFonts.inter( + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.textSubtitle1, fontSize: 16, fontWeight: FontWeight.w600, ), - textStyleYearButton: _datePickerTextStyleBase.copyWith( + textStyleYearButton: GoogleFonts.inter( + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.textWhite, fontSize: 16, fontWeight: FontWeight.w600, @@ -164,12 +183,14 @@ class _TransactionSearchViewState MaterialRoundedYearPickerStyle _buildYearPickerStyle() { return MaterialRoundedYearPickerStyle( backgroundPicker: Theme.of(context).extension<StackColors>()!.popupBG, - textStyleYear: _datePickerTextStyleBase.copyWith( + textStyleYear: GoogleFonts.inter( + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.textSubtitle2, fontWeight: FontWeight.w600, fontSize: 16, ), - textStyleYearSelected: _datePickerTextStyleBase.copyWith( + textStyleYearSelected: GoogleFonts.inter( + letterSpacing: 0.5, color: Theme.of(context).extension<StackColors>()!.accentColorDark, fontWeight: FontWeight.w600, fontSize: 18, diff --git a/lib/utilities/text_styles.dart b/lib/utilities/text_styles.dart index 09b58d3aa..1f19da807 100644 --- a/lib/utilities/text_styles.dart +++ b/lib/utilities/text_styles.dart @@ -27,6 +27,12 @@ class STextStyles { fontSize: 16, ); + static TextStyle titleBold12_400(BuildContext context) => GoogleFonts.inter( + color: Theme.of(context).extension<StackColors>()!.textDark, + fontWeight: FontWeight.w400, + fontSize: 16, + ); + static TextStyle subtitle(BuildContext context) => GoogleFonts.inter( color: Theme.of(context).extension<StackColors>()!.textDark, fontWeight: FontWeight.w400, @@ -75,6 +81,12 @@ class STextStyles { fontSize: 12, ); + static TextStyle label700(BuildContext context) => GoogleFonts.inter( + color: Theme.of(context).extension<StackColors>()!.textSubtitle1, + fontWeight: FontWeight.w700, + fontSize: 12, + ); + static TextStyle itemSubtitle(BuildContext context) => GoogleFonts.inter( color: Theme.of(context).extension<StackColors>()!.infoItemLabel, fontWeight: FontWeight.w500, @@ -87,6 +99,13 @@ class STextStyles { fontSize: 14, ); + static TextStyle itemSubtitle12_600(BuildContext context) => + GoogleFonts.inter( + color: Theme.of(context).extension<StackColors>()!.textDark, + fontWeight: FontWeight.w500, + fontSize: 14, + ); + static TextStyle fieldLabel(BuildContext context) => GoogleFonts.inter( color: Theme.of(context).extension<StackColors>()!.textSubtitle2, fontWeight: FontWeight.w500, diff --git a/lib/widgets/transaction_card.dart b/lib/widgets/transaction_card.dart index 35331d398..4a8da2357 100644 --- a/lib/widgets/transaction_card.dart +++ b/lib/widgets/transaction_card.dart @@ -175,10 +175,8 @@ class _TransactionCardState extends ConsumerState<TransactionCard> { : _transaction.amount; return Text( "${Format.satoshiAmountToPrettyString(amount, locale)} ${coin.ticker}", - style: STextStyles.itemSubtitle12(context) - .copyWith( - fontWeight: FontWeight.w600, - ), + style: + STextStyles.itemSubtitle12_600(context), ); }, ),