refactor: create IndicatorDotTheme

This commit is contained in:
Rafael Saes 2023-07-03 16:21:11 -03:00
parent 89ab198064
commit e67e07dd7b
5 changed files with 32 additions and 27 deletions

View file

@ -156,11 +156,8 @@ class _DashboardPageView extends BasePage {
radius: 6.0, radius: 6.0,
dotWidth: 6.0, dotWidth: 6.0,
dotHeight: 6.0, dotHeight: 6.0,
dotColor: Theme.of(context).indicatorColor, dotColor: Theme.of(context).extension<DashboardPageTheme>()!.indicatorDotTheme!.indicatorColor,
activeDotColor: Theme.of(context) activeDotColor: Theme.of(context).extension<DashboardPageTheme>()!.indicatorDotTheme!.activeIndicatorColor),
.accentTextTheme!
.headlineMedium!
.backgroundColor!),
), ),
); );
} }

View file

@ -1,6 +1,7 @@
import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
import 'package:cake_wallet/themes/extensions/dashboard_page_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/exchange_page_theme.dart';
import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart'; import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
import 'package:cake_wallet/themes/light_theme.dart'; import 'package:cake_wallet/themes/light_theme.dart';
@ -22,11 +23,15 @@ class BrightTheme extends LightTheme {
Color get containerColor => Palette.moderateLavender; Color get containerColor => Palette.moderateLavender;
@override @override
DashboardPageTheme get pageGradientTheme => super.pageGradientTheme.copyWith( DashboardPageTheme get dashboardPageTheme =>
firstGradientBackgroundColor: Palette.blueCraiola, super.dashboardPageTheme.copyWith(
secondGradientBackgroundColor: Palette.pinkFlamingo, firstGradientBackgroundColor: Palette.blueCraiola,
thirdGradientBackgroundColor: Palette.redHat, secondGradientBackgroundColor: Palette.pinkFlamingo,
textColor: Colors.white); thirdGradientBackgroundColor: Palette.redHat,
textColor: Colors.white,
indicatorDotTheme: IndicatorDotTheme(
indicatorColor: Colors.white.withOpacity(0.5),
activeIndicatorColor: Colors.white));
@override @override
SyncIndicatorTheme get syncIndicatorStyle => SyncIndicatorTheme get syncIndicatorStyle =>
@ -147,16 +152,12 @@ class BrightTheme extends LightTheme {
// display2 -> displaySmall // display2 -> displaySmall
displaySmall: TextStyle( displaySmall: TextStyle(
color: Colors.white.withOpacity(0.5), // estimated fee (send page) color: Colors.white.withOpacity(0.5), // estimated fee (send page)
backgroundColor: PaletteDark.darkCyanBlue
.withOpacity(0.67), // dot color for indicator on send page
decorationColor: decorationColor:
Palette.shadowWhite // template dotted border (send page) Palette.shadowWhite // template dotted border (send page)
), ),
// display3 -> displayMedium // display3 -> displayMedium
displayMedium: TextStyle( displayMedium: TextStyle(
color: Palette.darkBlueCraiola, // template new text (send page) color: Palette.darkBlueCraiola, // template new text (send page)
backgroundColor: PaletteDark
.darkNightBlue, // active dot color for indicator on send page
decorationColor: decorationColor:
Palette.shadowWhite // template background color (send page) Palette.shadowWhite // template background color (send page)
), ),
@ -207,7 +208,6 @@ class BrightTheme extends LightTheme {
color: Palette.blueCraiola, // first gradient color (menu header) color: Palette.blueCraiola, // first gradient color (menu header)
decorationColor: decorationColor:
Palette.pinkFlamingo, // second gradient color(menu header) Palette.pinkFlamingo, // second gradient color(menu header)
backgroundColor: Colors.white // active dot color
), ),
)); ));
} }

View file

@ -1,7 +1,9 @@
import 'package:cake_wallet/themes/extensions/address_theme.dart'; import 'package:cake_wallet/themes/extensions/address_theme.dart';
import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart'; import 'package:cake_wallet/themes/extensions/cake_scrollbar_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/exchange_page_theme.dart';
import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart'; import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
@ -84,6 +86,13 @@ class DarkTheme extends ThemeBase {
AddressTheme get addressTheme => AddressTheme get addressTheme =>
AddressTheme(actionButtonColor: PaletteDark.nightBlue); AddressTheme(actionButtonColor: PaletteDark.nightBlue);
@override
DashboardPageTheme get dashboardPageTheme =>
super.dashboardPageTheme.copyWith(
indicatorDotTheme: IndicatorDotTheme(
indicatorColor: PaletteDark.cyanBlue,
activeIndicatorColor: Colors.white));
@override @override
ThemeData get themeData => super.themeData.copyWith( ThemeData get themeData => super.themeData.copyWith(
indicatorColor: PaletteDark.cyanBlue, // page indicator indicatorColor: PaletteDark.cyanBlue, // page indicator
@ -184,16 +193,12 @@ class DarkTheme extends ThemeBase {
// display2 -> displaySmall // display2 -> displaySmall
displaySmall: TextStyle( displaySmall: TextStyle(
color: Colors.white, // estimated fee (send page) color: Colors.white, // estimated fee (send page)
backgroundColor:
PaletteDark.cyanBlue, // dot color for indicator on send page
decorationColor: decorationColor:
PaletteDark.darkCyanBlue // template dotted border (send page) PaletteDark.darkCyanBlue // template dotted border (send page)
), ),
// display3 -> displayMedium // display3 -> displayMedium
displayMedium: TextStyle( displayMedium: TextStyle(
color: PaletteDark.darkCyanBlue, // template new text (send page) color: PaletteDark.darkCyanBlue, // template new text (send page)
backgroundColor:
Colors.white, // active dot color for indicator on send page
decorationColor: PaletteDark decorationColor: PaletteDark
.darkVioletBlue // template background color (send page) .darkVioletBlue // template background color (send page)
), ),
@ -246,7 +251,6 @@ class DarkTheme extends ThemeBase {
.deepPurpleBlue, // first gradient color (menu header) .deepPurpleBlue, // first gradient color (menu header)
decorationColor: PaletteDark decorationColor: PaletteDark
.deepPurpleBlue, // second gradient color(menu header) .deepPurpleBlue, // second gradient color(menu header)
backgroundColor: Colors.white // active dot color
), ),
), ),
); );

View file

@ -1,7 +1,9 @@
import 'package:cake_wallet/themes/extensions/address_theme.dart'; import 'package:cake_wallet/themes/extensions/address_theme.dart';
import 'package:cake_wallet/themes/extensions/balance_page_theme.dart'; import 'package:cake_wallet/themes/extensions/balance_page_theme.dart';
import 'package:cake_wallet/themes/extensions/cake_scrollbar_theme.dart'; import 'package:cake_wallet/themes/extensions/cake_scrollbar_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/exchange_page_theme.dart';
import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; import 'package:cake_wallet/themes/extensions/keyboard_theme.dart';
import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart'; import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
@ -85,6 +87,13 @@ class LightTheme extends ThemeBase {
AddressTheme get addressTheme => AddressTheme get addressTheme =>
AddressTheme(actionButtonColor: Palette.shadowWhite); AddressTheme(actionButtonColor: Palette.shadowWhite);
@override
DashboardPageTheme get dashboardPageTheme =>
super.dashboardPageTheme.copyWith(
indicatorDotTheme: IndicatorDotTheme(
indicatorColor: PaletteDark.darkCyanBlue.withOpacity(0.67),
activeIndicatorColor: PaletteDark.darkNightBlue));
@override @override
ThemeData get themeData => super.themeData.copyWith( ThemeData get themeData => super.themeData.copyWith(
indicatorColor: indicatorColor:
@ -185,16 +194,12 @@ class LightTheme extends ThemeBase {
// display2 -> displaySmall // display2 -> displaySmall
displaySmall: TextStyle( displaySmall: TextStyle(
color: Colors.white.withOpacity(0.5), // estimated fee (send page) color: Colors.white.withOpacity(0.5), // estimated fee (send page)
backgroundColor: PaletteDark.darkCyanBlue
.withOpacity(0.67), // dot color for indicator on send page
decorationColor: decorationColor:
Palette.moderateLavender // template dotted border (send page) Palette.moderateLavender // template dotted border (send page)
), ),
// display3 -> displayMedium // display3 -> displayMedium
displayMedium: TextStyle( displayMedium: TextStyle(
color: Palette.darkBlueCraiola, // template new text (send page) color: Palette.darkBlueCraiola, // template new text (send page)
backgroundColor: PaletteDark
.darkNightBlue, // active dot color for indicator on send page
decorationColor: decorationColor:
Palette.blueAlice // template background color (send page) Palette.blueAlice // template background color (send page)
), ),
@ -243,7 +248,6 @@ class LightTheme extends ThemeBase {
headlineMedium: TextStyle( headlineMedium: TextStyle(
color: Palette.blueCraiola, // first gradient color (menu header) color: Palette.blueCraiola, // first gradient color (menu header)
decorationColor: Palette.blueGreyCraiola, // second gradient color(menu header) decorationColor: Palette.blueGreyCraiola, // second gradient color(menu header)
backgroundColor: PaletteDark.darkNightBlue // active dot color
), ),
), ),
); );

View file

@ -40,7 +40,7 @@ abstract class ThemeBase {
colorScheme: colorScheme, colorScheme: colorScheme,
textTheme: TextTheme().apply(fontFamily: 'Lato')); textTheme: TextTheme().apply(fontFamily: 'Lato'));
DashboardPageTheme get pageGradientTheme => DashboardPageTheme( DashboardPageTheme get dashboardPageTheme => DashboardPageTheme(
firstGradientBackgroundColor: backgroundColor, firstGradientBackgroundColor: backgroundColor,
secondGradientBackgroundColor: backgroundColor, secondGradientBackgroundColor: backgroundColor,
thirdGradientBackgroundColor: backgroundColor, thirdGradientBackgroundColor: backgroundColor,
@ -69,7 +69,7 @@ abstract class ThemeBase {
cardColor: containerColor, cardColor: containerColor,
dialogBackgroundColor: dialogBackgroundColor, dialogBackgroundColor: dialogBackgroundColor,
extensions: [ extensions: [
pageGradientTheme, dashboardPageTheme,
scrollbarTheme, scrollbarTheme,
syncIndicatorStyle, syncIndicatorStyle,
keyboardTheme, keyboardTheme,