refactor: create DashboardPageTheme and use textColor

This commit is contained in:
Rafael Saes 2023-07-03 15:15:58 -03:00
parent 09e2567953
commit bc8ce7bf60
31 changed files with 155 additions and 249 deletions

View file

@ -30,6 +30,7 @@ import 'package:shared_preferences/shared_preferences.dart';
import 'package:smooth_page_indicator/smooth_page_indicator.dart';
import 'package:cake_wallet/main.dart';
import 'package:cake_wallet/src/screens/release_notes/release_notes_screen.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class DashboardPage extends StatelessWidget {
DashboardPage({
@ -89,10 +90,7 @@ class _DashboardPageView extends BasePage {
@override
Widget trailing(BuildContext context) {
final menuButton = Image.asset('assets/images/menu.png',
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor);
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor);
return Container(
alignment: Alignment.centerRight,
@ -199,10 +197,7 @@ class _DashboardPageView extends BasePage {
color: action.isEnabled?.call(
dashboardViewModel) ??
true
? Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!
? Theme.of(context).extension<DashboardPageTheme>()!.textColor
: Theme.of(context)
.accentTextTheme!
.displaySmall!

View file

@ -1,4 +1,5 @@
import 'package:auto_size_text/auto_size_text.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
import 'package:flutter/material.dart';
@ -42,10 +43,7 @@ class DesktopActionButton extends StatelessWidget {
height: 30,
width: 30,
color: isEnabled
? Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!
? Theme.of(context).extension<DashboardPageTheme>()!.textColor
: Theme.of(context)
.accentTextTheme!
.displaySmall!
@ -59,10 +57,7 @@ class DesktopActionButton extends StatelessWidget {
fontFamily: 'Lato',
fontWeight: FontWeight.bold,
color: isEnabled
? Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!
? Theme.of(context).extension<DashboardPageTheme>()!.textColor
: null,
height: 1,
),

View file

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class ActionButton extends StatelessWidget {
ActionButton(
@ -46,10 +47,7 @@ class ActionButton extends StatelessWidget {
style: TextStyle(
fontSize: 10,
color: textColor ??
Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!),
Theme.of(context).extension<DashboardPageTheme>()!.textColor),
)
],
),

View file

@ -24,6 +24,7 @@ import 'package:keyboard_actions/keyboard_actions.dart';
import 'package:mobx/mobx.dart';
import 'package:shared_preferences/shared_preferences.dart';
import 'package:cake_wallet/di.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class AddressPage extends BasePage {
AddressPage({
@ -55,7 +56,7 @@ class AddressPage extends BasePage {
@override
Color? get titleColor =>
currentTheme.themeData.accentTextTheme.displayMedium!.backgroundColor;
currentTheme.themeData.extension<DashboardPageTheme>()!.textColor;
@override
bool get resizeToAvoidBottomInset => false;
@ -204,18 +205,12 @@ class AddressPage extends BasePage {
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!),
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor),
)),
Icon(
Icons.arrow_forward_ios,
size: 14,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
)
],
),

View file

@ -1,4 +1,5 @@
import 'package:flutter/material.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class AnonpayTransactionRow extends StatelessWidget {
AnonpayTransactionRow({
@ -37,12 +38,12 @@ class AnonpayTransactionRow extends StatelessWidget {
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!)),
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor)),
Text(amount + ' ' + currency,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!))
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor))
]),
SizedBox(height: 5),
Row(mainAxisAlignment: MainAxisAlignment.spaceBetween, children: <Widget>[

View file

@ -8,6 +8,7 @@ import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:auto_size_text/auto_size_text.dart';
import 'package:cake_wallet/src/widgets/introducing_card.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class BalancePage extends StatelessWidget {
BalancePage({required this.dashboardViewModel, required this.settingsStore});
@ -36,10 +37,7 @@ class BalancePage extends StatelessWidget {
fontSize: 24,
fontFamily: 'Lato',
fontWeight: FontWeight.w600,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
height: 1),
maxLines: 1,
textAlign: TextAlign.center);
@ -129,10 +127,7 @@ class BalancePage extends StatelessWidget {
fontSize: 24,
fontFamily: 'Lato',
fontWeight: FontWeight.w900,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
height: 1),
maxLines: 1,
textAlign: TextAlign.start),
@ -142,10 +137,7 @@ class BalancePage extends StatelessWidget {
fontSize: 28,
fontFamily: 'Lato',
fontWeight: FontWeight.w800,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
height: 1)),
]),
SizedBox(
@ -157,10 +149,7 @@ class BalancePage extends StatelessWidget {
fontSize: 16,
fontFamily: 'Lato',
fontWeight: FontWeight.w500,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
height: 1)),
SizedBox(height: 26),
if (frozenBalance.isNotEmpty)
@ -182,10 +171,7 @@ class BalancePage extends StatelessWidget {
fontSize: 20,
fontFamily: 'Lato',
fontWeight: FontWeight.w400,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
height: 1),
maxLines: 1,
textAlign: TextAlign.center),
@ -197,10 +183,7 @@ class BalancePage extends StatelessWidget {
fontSize: 12,
fontFamily: 'Lato',
fontWeight: FontWeight.w400,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
height: 1),
),
SizedBox(height: 24)
@ -222,10 +205,7 @@ class BalancePage extends StatelessWidget {
fontSize: 20,
fontFamily: 'Lato',
fontWeight: FontWeight.w400,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
height: 1),
maxLines: 1,
textAlign: TextAlign.center),
@ -239,10 +219,7 @@ class BalancePage extends StatelessWidget {
fontSize: 12,
fontFamily: 'Lato',
fontWeight: FontWeight.w400,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
height: 1),
)
])),

View file

@ -3,6 +3,7 @@ import 'package:cake_wallet/utils/show_pop_up.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/view_model/dashboard/dashboard_view_model.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class HeaderRow extends StatelessWidget {
HeaderRow({required this.dashboardViewModel});
@ -27,10 +28,7 @@ class HeaderRow extends StatelessWidget {
style: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w500,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!),
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor),
),
GestureDetector(
onTap: () {

View file

@ -8,6 +8,7 @@ import 'package:cw_core/wallet_type.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class MarketPlacePage extends StatelessWidget {
MarketPlacePage({
@ -40,10 +41,7 @@ class MarketPlacePage extends StatelessWidget {
style: TextStyle(
fontSize: 24,
fontWeight: FontWeight.w500,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
),
),
Expanded(

View file

@ -1,6 +1,7 @@
import 'package:cake_wallet/buy/buy_provider_description.dart';
import 'package:cake_wallet/buy/get_buy_provider_icon.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class OrderRow extends StatelessWidget {
OrderRow({
@ -48,14 +49,14 @@ class OrderRow extends StatelessWidget {
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor
)),
formattedAmount != null
? Text(formattedAmount! + ' ' + to,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor
))
: Container()
]),

View file

@ -7,6 +7,7 @@ import 'package:cake_wallet/view_model/dashboard/receive_option_view_model.dart'
import 'package:flutter/material.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class PresentReceiveOptionPicker extends StatelessWidget {
PresentReceiveOptionPicker(
@ -18,10 +19,7 @@ class PresentReceiveOptionPicker extends StatelessWidget {
@override
Widget build(BuildContext context) {
final textIconTheme = gradientBackground
? Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!
? Theme.of(context).extension<DashboardPageTheme>()!.textColor
: Colors.white;
final arrowBottom = Image.asset(
'assets/images/arrow_bottom_purple_icon.png',

View file

@ -1,6 +1,7 @@
import 'package:flutter/material.dart';
import 'package:cw_core/crypto_currency.dart';
import 'package:cake_wallet/exchange/exchange_provider_description.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class TradeRow extends StatelessWidget {
TradeRow({
@ -43,14 +44,14 @@ class TradeRow extends StatelessWidget {
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!)),
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor)),
formattedAmount != null
? Text(formattedAmount! + ' ' + amountCrypto,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color:
Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!))
Theme.of(context).extension<DashboardPageTheme>()!.textColor))
: Container()
]),
SizedBox(height: 5),

View file

@ -1,5 +1,6 @@
import 'package:flutter/material.dart';
import 'package:cw_core/transaction_direction.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class TransactionRow extends StatelessWidget {
TransactionRow(
@ -54,14 +55,12 @@ class TransactionRow extends StatelessWidget {
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).accentTextTheme!
.displayMedium!.backgroundColor!)),
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor)),
Text(formattedAmount,
style: TextStyle(
fontSize: 16,
fontWeight: FontWeight.w500,
color: Theme.of(context).accentTextTheme!
.displayMedium!.backgroundColor!))
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor))
]),
SizedBox(height: 5),
Row(

View file

@ -10,6 +10,7 @@ import 'package:cake_wallet/view_model/ionia/ionia_account_view_model.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class IoniaAccountCardsPage extends BasePage {
IoniaAccountCardsPage(this.ioniaAccountViewModel);
@ -161,10 +162,7 @@ class _IoniaCardListView extends StatelessWidget {
if(isLoading){
return Center(
child: CircularProgressIndicator(
backgroundColor: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
backgroundColor: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
valueColor: AlwaysStoppedAnimation<Color>(
Theme.of(context).extension<ExchangePageTheme>()!.firstGradientBottomPanelColor),
),

View file

@ -18,6 +18,7 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class IoniaManageCardsPage extends BasePage {
IoniaManageCardsPage(this._cardsListViewModel): searchFocusNode = FocusNode() {
@ -59,10 +60,7 @@ class IoniaManageCardsPage extends BasePage {
Widget leading(BuildContext context) {
final _backButton = Icon(
Icons.arrow_back_ios,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
size: 16,
);
@ -94,10 +92,7 @@ class IoniaManageCardsPage extends BasePage {
return Text(
S.of(context).gift_cards,
style: textMediumSemiBold(
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
),
);
}
@ -230,7 +225,7 @@ class _IoniaManageCardsPageBodyState extends State<IoniaManageCardsPageBody> {
title: merchant.legalName,
subTitle: merchant.avaibilityStatus,
backgroundColor: Theme.of(context).extension<SyncIndicatorTheme>()!.syncedBackgroundColor,
titleColor: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!,
titleColor: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
subtitleColor: Theme.of(context).accentTextTheme!.displaySmall!.backgroundColor!,
discount: merchant.discount,
);
@ -251,7 +246,7 @@ class _IoniaManageCardsPageBodyState extends State<IoniaManageCardsPageBody> {
}
return Center(
child: CircularProgressIndicator(
backgroundColor: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!,
backgroundColor: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
valueColor: AlwaysStoppedAnimation<Color>(Theme.of(context).extension<ExchangePageTheme>()!.firstGradientBottomPanelColor),
),
);
@ -280,7 +275,7 @@ class _SearchWidget extends StatelessWidget {
return TextField(
focusNode: focusNode,
style: TextStyle(color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!),
style: TextStyle(color: Theme.of(context).extension<DashboardPageTheme>()!.textColor),
controller: controller,
decoration: InputDecoration(
filled: true,
@ -335,7 +330,7 @@ class _TrailingIcon extends StatelessWidget {
onPressed: onPressed,
icon: Image.asset(
asset,
color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
),
),
);

View file

@ -2,7 +2,7 @@ import 'package:cake_wallet/ionia/ionia_gift_card.dart';
import 'package:cake_wallet/routes.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/themes/extensions/dashboard_gradient_theme.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
import 'package:cake_wallet/typography.dart';
import 'package:flutter/material.dart';
@ -78,8 +78,8 @@ class _GradiantContainer extends StatelessWidget {
borderRadius: BorderRadius.circular(15),
gradient: LinearGradient(
colors: [
Theme.of(context).extension<DashboardGradientTheme>()!.secondGradientColor,
Theme.of(context).extension<DashboardGradientTheme>()!.firstGradientColor,
Theme.of(context).extension<DashboardPageTheme>()!.secondGradientBackgroundColor,
Theme.of(context).extension<DashboardPageTheme>()!.firstGradientBackgroundColor,
],
begin: Alignment.topRight,
end: Alignment.bottomLeft,

View file

@ -12,6 +12,7 @@ import 'package:cake_wallet/src/screens/receive/widgets/copy_link_item.dart';
import 'package:device_display_brightness/device_display_brightness.dart';
import 'package:flutter/material.dart';
import 'package:qr_flutter/qr_flutter.dart' as qr;
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class AnonPayReceivePage extends BasePage {
final AnonpayInfoBase invoiceInfo;
@ -31,10 +32,7 @@ class AnonPayReceivePage extends BasePage {
Widget leading(BuildContext context) {
final _backButton = Icon(
Icons.arrow_back_ios,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
size: 16,
);
@ -61,10 +59,7 @@ class AnonPayReceivePage extends BasePage {
fontSize: 18.0,
fontWeight: FontWeight.bold,
fontFamily: 'Lato',
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!),
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor),
),
Text(
invoiceInfo is AnonpayInvoiceInfo
@ -147,10 +142,7 @@ class AnonPayReceivePage extends BasePage {
decoration: BoxDecoration(
border: Border.all(
width: 3,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
),
),
child: QrImage(

View file

@ -3,6 +3,7 @@ import 'package:cake_wallet/src/widgets/gradient_background.dart';
import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/src/screens/base_page.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class FullscreenQRPage extends BasePage {
FullscreenQRPage({required this.qrViewData});
@ -19,10 +20,7 @@ class FullscreenQRPage extends BasePage {
Widget leading(BuildContext context) {
final _backButton = Icon(
Icons.arrow_back_ios,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
size: 16,
);
@ -62,10 +60,7 @@ class FullscreenQRPage extends BasePage {
decoration: BoxDecoration(
border: Border.all(
width: 3,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!)),
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor)),
child: Container(
decoration: BoxDecoration(
border: Border.all(width: 3, color: Colors.white)),

View file

@ -5,6 +5,7 @@ import 'package:cake_wallet/utils/show_bar.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:share_plus/share_plus.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class CopyLinkItem extends StatelessWidget {
const CopyLinkItem({super.key, required this.url, required this.title});
@ -14,10 +15,7 @@ class CopyLinkItem extends StatelessWidget {
@override
Widget build(BuildContext context) {
final copyImage = Image.asset('assets/images/copy_address.png',
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!);
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor);
return Row(
mainAxisAlignment: MainAxisAlignment.center,
@ -25,10 +23,7 @@ class CopyLinkItem extends StatelessWidget {
Text(
title,
style: textMedium(
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
),
),
SizedBox(width: 50),
@ -51,10 +46,7 @@ class CopyLinkItem extends StatelessWidget {
onPressed: () => Share.share(url),
icon: Icon(
Icons.share,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
),
)
],

View file

@ -3,6 +3,7 @@ import 'package:cake_wallet/utils/responsive_layout_util.dart';
import 'package:cw_core/currency.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class CurrencyInputField extends StatelessWidget {
const CurrencyInputField({
@ -24,7 +25,7 @@ class CurrencyInputField extends StatelessWidget {
Widget build(BuildContext context) {
final arrowBottomPurple = Image.asset(
'assets/images/arrow_bottom_purple_icon.png',
color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
height: 8,
);
// This magic number for wider screen sets the text input focus at center of the inputfield
@ -50,9 +51,9 @@ class CurrencyInputField extends StatelessWidget {
fontWeight: FontWeight.w600,
),
borderColor: Theme.of(context).accentTextTheme!.titleLarge!.backgroundColor!,
textColor: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!,
textColor: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
textStyle: TextStyle(
color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
),
prefixIcon: Padding(
padding: EdgeInsets.only(
@ -75,10 +76,7 @@ class CurrencyInputField extends StatelessWidget {
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 16,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
),
),
if (selectedCurrency.tag != null)
@ -113,10 +111,7 @@ class CurrencyInputField extends StatelessWidget {
style: TextStyle(
fontWeight: FontWeight.w600,
fontSize: 20,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
),
),
),

View file

@ -12,6 +12,7 @@ import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/src/screens/receive/widgets/qr_image.dart';
import 'package:cake_wallet/view_model/wallet_address_list/wallet_address_list_view_model.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class QRWidget extends StatelessWidget {
QRWidget({
@ -51,10 +52,7 @@ class QRWidget extends StatelessWidget {
style: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!),
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor),
),
),
Row(
@ -85,10 +83,7 @@ class QRWidget extends StatelessWidget {
decoration: BoxDecoration(
border: Border.all(
width: 3,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
),
),
child: Container(
@ -152,10 +147,7 @@ class QRWidget extends StatelessWidget {
style: TextStyle(
fontSize: 15,
fontWeight: FontWeight.w500,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!),
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor),
),
),
Padding(

View file

@ -1,7 +1,7 @@
import 'dart:convert';
import 'package:cake_wallet/src/widgets/alert_background.dart';
import 'package:cake_wallet/src/widgets/alert_close_button.dart';
import 'package:cake_wallet/themes/extensions/dashboard_gradient_theme.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
import 'package:cake_wallet/wallet_type_utils.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
@ -34,8 +34,8 @@ class ReleaseNotesScreen extends StatelessWidget {
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(30.0),
gradient: LinearGradient(colors: [
Theme.of(context).extension<DashboardGradientTheme>()!.firstGradientColor,
Theme.of(context).extension<DashboardGradientTheme>()!.secondGradientColor,
Theme.of(context).extension<DashboardPageTheme>()!.firstGradientBackgroundColor,
Theme.of(context).extension<DashboardPageTheme>()!.secondGradientBackgroundColor,
], begin: Alignment.centerLeft, end: Alignment.centerRight)),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 24.0),
@ -52,10 +52,7 @@ class ReleaseNotesScreen extends StatelessWidget {
fontSize: 24.0,
fontWeight: FontWeight.bold,
fontFamily: 'Lato',
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
),
child: Text(title),
),
@ -122,10 +119,7 @@ class ReleaseNotesScreen extends StatelessWidget {
decoration: TextDecoration.none,
fontSize: 16.0,
fontFamily: 'Lato',
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
),
child: Row(
crossAxisAlignment: CrossAxisAlignment.start,

View file

@ -13,6 +13,7 @@ import 'package:animate_do/animate_do.dart';
import 'package:flutter_mobx/flutter_mobx.dart';
import 'package:url_launcher/url_launcher.dart';
import 'package:cake_wallet/generated/i18n.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class YatEmojiId extends StatelessWidget {
YatEmojiId(this.emojiId);
@ -90,7 +91,7 @@ class YatEmojiId extends StatelessWidget {
fontSize: 32,
fontWeight: FontWeight.bold,
fontFamily: 'Lato',
color: Theme.of(context).accentTextTheme!.displayMedium!.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
decoration: TextDecoration.none,
)
),

View file

@ -1,4 +1,4 @@
import 'package:cake_wallet/themes/extensions/dashboard_gradient_theme.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
import 'package:flutter/material.dart';
class GradientBackground extends StatelessWidget {
@ -13,14 +13,14 @@ class GradientBackground extends StatelessWidget {
gradient: LinearGradient(
colors: [
Theme.of(context)
.extension<DashboardGradientTheme>()!
.firstGradientColor,
.extension<DashboardPageTheme>()!
.firstGradientBackgroundColor,
Theme.of(context)
.extension<DashboardGradientTheme>()!
.secondGradientColor,
.extension<DashboardPageTheme>()!
.secondGradientBackgroundColor,
Theme.of(context)
.extension<DashboardGradientTheme>()!
.thirdGradientColor,
.extension<DashboardPageTheme>()!
.thirdGradientBackgroundColor,
],
begin: Alignment.topRight,
end: Alignment.bottomLeft,

View file

@ -2,6 +2,7 @@ import 'package:auto_size_text/auto_size_text.dart';
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/palette.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class IntroducingCard extends StatelessWidget {
IntroducingCard(
@ -45,10 +46,7 @@ class IntroducingCard extends StatelessWidget {
fontSize: 24,
fontFamily: 'Lato',
fontWeight: FontWeight.bold,
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
height: 1),
maxLines: 1,
textAlign: TextAlign.center),
@ -58,10 +56,7 @@ class IntroducingCard extends StatelessWidget {
style: TextStyle(
fontSize: 12,
fontFamily: 'Lato',
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
height: 1)),
],
),

View file

@ -1,5 +1,6 @@
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
import 'package:flutter/material.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
class MarketPlaceItem extends StatelessWidget {
@ -40,10 +41,7 @@ class MarketPlaceItem extends StatelessWidget {
Text(
title,
style: TextStyle(
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
fontSize: 24,
fontWeight: FontWeight.w900,
),
@ -52,10 +50,7 @@ class MarketPlaceItem extends StatelessWidget {
Text(
subTitle,
style: TextStyle(
color: Theme.of(context)
.accentTextTheme!
.displayMedium!
.backgroundColor!,
color: Theme.of(context).extension<DashboardPageTheme>()!.textColor,
fontWeight: FontWeight.w500,
fontFamily: 'Lato'),
)

View file

@ -1,4 +1,4 @@
import 'package:cake_wallet/themes/extensions/dashboard_gradient_theme.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
import 'package:cake_wallet/themes/light_theme.dart';
@ -20,10 +20,11 @@ class BrightTheme extends LightTheme {
Color get containerColor => Palette.moderateLavender;
@override
DashboardGradientTheme get pageGradientTheme => DashboardGradientTheme(
firstGradientColor: Palette.blueCraiola,
secondGradientColor: Palette.pinkFlamingo,
thirdGradientColor: Palette.redHat);
DashboardPageTheme get pageGradientTheme => super.pageGradientTheme.copyWith(
firstGradientBackgroundColor: Palette.blueCraiola,
secondGradientBackgroundColor: Palette.pinkFlamingo,
thirdGradientBackgroundColor: Palette.redHat,
textColor: Colors.white);
@override
SyncIndicatorTheme get syncIndicatorStyle =>
@ -210,8 +211,6 @@ class BrightTheme extends LightTheme {
color: Palette.darkGray, // hint text (new wallet page)
decorationColor:
Palette.periwinkleCraiola, // underline (new wallet page)
backgroundColor:
Colors.white // menu, icons, balance (dashboard page)
),
));
}

View file

@ -245,8 +245,6 @@ class DarkTheme extends ThemeBase {
color: PaletteDark.cyanBlue, // hint text (new wallet page)
decorationColor:
PaletteDark.darkGrey, // underline (new wallet page)
backgroundColor:
Colors.white // menu, icons, balance (dashboard page)
),
),
);

View file

@ -1,41 +0,0 @@
import 'package:flutter/material.dart';
class DashboardGradientTheme extends ThemeExtension<DashboardGradientTheme> {
final Color firstGradientColor;
final Color secondGradientColor;
final Color thirdGradientColor;
DashboardGradientTheme(
{required this.firstGradientColor,
required this.secondGradientColor,
required this.thirdGradientColor});
@override
Object get type => DashboardGradientTheme;
@override
DashboardGradientTheme copyWith(
{Color? firstGradientColor,
Color? secondGradientColor,
Color? thirdGradientColor}) =>
DashboardGradientTheme(
firstGradientColor: firstGradientColor ?? this.firstGradientColor,
secondGradientColor: secondGradientColor ?? this.secondGradientColor,
thirdGradientColor: thirdGradientColor ?? this.thirdGradientColor);
@override
DashboardGradientTheme lerp(ThemeExtension<DashboardGradientTheme>? other, double t) {
if (other is! DashboardGradientTheme) {
return this;
}
return DashboardGradientTheme(
firstGradientColor:
Color.lerp(firstGradientColor, other.firstGradientColor, t)!,
secondGradientColor:
Color.lerp(secondGradientColor, other.secondGradientColor, t)!,
thirdGradientColor:
Color.lerp(thirdGradientColor, other.thirdGradientColor, t)!);
}
}

View file

@ -0,0 +1,51 @@
import 'package:flutter/material.dart';
class DashboardPageTheme extends ThemeExtension<DashboardPageTheme> {
final Color firstGradientBackgroundColor;
final Color secondGradientBackgroundColor;
final Color thirdGradientBackgroundColor;
final Color textColor;
DashboardPageTheme(
{required this.firstGradientBackgroundColor,
required this.secondGradientBackgroundColor,
required this.thirdGradientBackgroundColor,
required this.textColor});
@override
Object get type => DashboardPageTheme;
@override
DashboardPageTheme copyWith(
{Color? firstGradientBackgroundColor,
Color? secondGradientBackgroundColor,
Color? thirdGradientBackgroundColor,
Color? textColor}) =>
DashboardPageTheme(
firstGradientBackgroundColor:
firstGradientBackgroundColor ?? this.firstGradientBackgroundColor,
secondGradientBackgroundColor: secondGradientBackgroundColor ??
this.secondGradientBackgroundColor,
thirdGradientBackgroundColor:
thirdGradientBackgroundColor ?? this.thirdGradientBackgroundColor,
textColor: textColor ?? this.textColor);
@override
DashboardPageTheme lerp(ThemeExtension<DashboardPageTheme>? other, double t) {
if (other is! DashboardPageTheme) {
return this;
}
return DashboardPageTheme(
firstGradientBackgroundColor: Color.lerp(firstGradientBackgroundColor,
other.firstGradientBackgroundColor, t) ??
firstGradientBackgroundColor,
secondGradientBackgroundColor: Color.lerp(secondGradientBackgroundColor,
other.secondGradientBackgroundColor, t) ??
secondGradientBackgroundColor,
thirdGradientBackgroundColor: Color.lerp(thirdGradientBackgroundColor,
other.thirdGradientBackgroundColor, t) ??
thirdGradientBackgroundColor,
textColor: Color.lerp(textColor, other.textColor, t) ?? textColor);
}
}

View file

@ -242,8 +242,6 @@ class LightTheme extends ThemeBase {
color: Palette.darkGray, // hint text (new wallet page)
decorationColor:
Palette.periwinkleCraiola, // underline (new wallet page)
backgroundColor:
Palette.darkBlueCraiola // menu, icons, balance (dashboard page)
),
),
);

View file

@ -1,5 +1,5 @@
import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart';
import 'package:cake_wallet/themes/extensions/dashboard_gradient_theme.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_theme.dart';
import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart';
import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
@ -37,10 +37,11 @@ abstract class ThemeBase {
colorScheme: colorScheme,
textTheme: TextTheme().apply(fontFamily: 'Lato'));
DashboardGradientTheme get pageGradientTheme => DashboardGradientTheme(
firstGradientColor: backgroundColor,
secondGradientColor: backgroundColor,
thirdGradientColor: backgroundColor);
DashboardPageTheme get pageGradientTheme => DashboardPageTheme(
firstGradientBackgroundColor: backgroundColor,
secondGradientBackgroundColor: backgroundColor,
thirdGradientBackgroundColor: backgroundColor,
textColor: primaryTextColor);
CakeScrollbarTheme get scrollbarTheme;