diff --git a/lib/src/screens/exchange_trade/information_page.dart b/lib/src/screens/exchange_trade/information_page.dart index 43c2e04dc..7f66531b0 100644 --- a/lib/src/screens/exchange_trade/information_page.dart +++ b/lib/src/screens/exchange_trade/information_page.dart @@ -2,6 +2,7 @@ import 'dart:ui'; import 'package:cake_wallet/generated/i18n.dart'; import 'package:cake_wallet/src/widgets/primary_button.dart'; import 'package:cake_wallet/themes/extensions/exchange_page_theme.dart'; +import 'package:cake_wallet/themes/extensions/info_theme.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:cake_wallet/src/widgets/alert_background.dart'; @@ -37,7 +38,7 @@ class InformationPage extends StatelessWidget { fontWeight: FontWeight.normal, fontFamily: 'Lato', decoration: TextDecoration.none, - color: Theme.of(context).accentTextTheme!.bodySmall!.decorationColor! + color: Theme.of(context).extension()!.textColor ), ), ), diff --git a/lib/themes/bright_theme.dart b/lib/themes/bright_theme.dart index 7aabde12b..cad143e1a 100644 --- a/lib/themes/bright_theme.dart +++ b/lib/themes/bright_theme.dart @@ -184,9 +184,5 @@ class BrightTheme extends LightTheme { titleLarge: TextStyle( backgroundColor: Palette.periwinkleCraiola, // picker divider ), - bodySmall: TextStyle( - decorationColor: - Palette.darkBlueCraiola, // text color (information page) - ), )); } diff --git a/lib/themes/dark_theme.dart b/lib/themes/dark_theme.dart index cf546e5c7..54228f1d2 100644 --- a/lib/themes/dark_theme.dart +++ b/lib/themes/dark_theme.dart @@ -5,6 +5,7 @@ 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/filter_theme.dart'; import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart'; +import 'package:cake_wallet/themes/extensions/info_theme.dart'; import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; import 'package:cake_wallet/themes/extensions/menu_theme.dart'; import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; @@ -118,6 +119,9 @@ class DarkTheme extends ThemeBase { restoreWalletButtonTextColor: Palette.darkBlueCraiola, createNewWalletButtonBackgroundColor: Colors.white); + @override + InfoTheme get infoTheme => InfoTheme(textColor: Palette.darkLavender); + @override ThemeData get themeData => super.themeData.copyWith( indicatorColor: PaletteDark.cyanBlue, // page indicator @@ -233,9 +237,6 @@ class DarkTheme extends ThemeBase { titleLarge: TextStyle( backgroundColor: PaletteDark.dividerColor, // picker divider ), - bodySmall: TextStyle( - decorationColor: Palette.darkLavender, // text color (information page) - ), ), ); } diff --git a/lib/themes/extensions/info_theme.dart b/lib/themes/extensions/info_theme.dart new file mode 100644 index 000000000..aaf9952ea --- /dev/null +++ b/lib/themes/extensions/info_theme.dart @@ -0,0 +1,21 @@ +import 'package:flutter/material.dart'; + +class InfoTheme extends ThemeExtension { + final Color textColor; + + InfoTheme({required this.textColor}); + + @override + InfoTheme copyWith({Color? textColor}) => + InfoTheme(textColor: textColor ?? this.textColor); + + @override + InfoTheme lerp(ThemeExtension? other, double t) { + if (other is! InfoTheme) { + return this; + } + + return InfoTheme( + textColor: Color.lerp(textColor, other.textColor, t) ?? textColor); + } +} diff --git a/lib/themes/light_theme.dart b/lib/themes/light_theme.dart index 4b9af1f35..a2654f131 100644 --- a/lib/themes/light_theme.dart +++ b/lib/themes/light_theme.dart @@ -5,6 +5,7 @@ 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/filter_theme.dart'; import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart'; +import 'package:cake_wallet/themes/extensions/info_theme.dart'; import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; import 'package:cake_wallet/themes/extensions/menu_theme.dart'; import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; @@ -119,6 +120,9 @@ class LightTheme extends ThemeBase { restoreWalletButtonTextColor: Colors.white, createNewWalletButtonBackgroundColor: Palette.protectiveBlue); + @override + InfoTheme get infoTheme => InfoTheme(textColor: Palette.darkBlueCraiola); + @override ThemeData get themeData => super.themeData.copyWith( indicatorColor: @@ -234,9 +238,6 @@ class LightTheme extends ThemeBase { titleLarge: TextStyle( backgroundColor: Palette.periwinkleCraiola, // picker divider ), - bodySmall: TextStyle( - decorationColor: Palette.darkBlueCraiola, // text color (information page) - ), ), ); } diff --git a/lib/themes/theme_base.dart b/lib/themes/theme_base.dart index e2867623d..a7acc291b 100644 --- a/lib/themes/theme_base.dart +++ b/lib/themes/theme_base.dart @@ -4,6 +4,7 @@ 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/filter_theme.dart'; +import 'package:cake_wallet/themes/extensions/info_theme.dart'; import 'package:cake_wallet/themes/extensions/keyboard_theme.dart'; import 'package:cake_wallet/themes/extensions/menu_theme.dart'; import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart'; @@ -73,6 +74,8 @@ abstract class ThemeBase { WalletListTheme get walletListTheme; + InfoTheme get infoTheme; + ThemeData get themeData => generatedThemeData.copyWith( primaryColor: primaryColor, cardColor: containerColor, @@ -91,6 +94,7 @@ abstract class ThemeBase { menuTheme, filterTheme, walletListTheme, + infoTheme, ], scrollbarTheme: ScrollbarThemeData( thumbColor: MaterialStateProperty.all(scrollbarTheme.thumbColor),