mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-26 20:46:21 +00:00
refactor: accentTextTheme.bodySmall.decorationColor -> InfoTheme.textColor
This commit is contained in:
parent
7f929ee976
commit
b5c90c2f9e
6 changed files with 35 additions and 11 deletions
|
@ -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<InfoTheme>()!.textColor
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
@ -184,9 +184,5 @@ class BrightTheme extends LightTheme {
|
|||
titleLarge: TextStyle(
|
||||
backgroundColor: Palette.periwinkleCraiola, // picker divider
|
||||
),
|
||||
bodySmall: TextStyle(
|
||||
decorationColor:
|
||||
Palette.darkBlueCraiola, // text color (information page)
|
||||
),
|
||||
));
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
21
lib/themes/extensions/info_theme.dart
Normal file
21
lib/themes/extensions/info_theme.dart
Normal file
|
@ -0,0 +1,21 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class InfoTheme extends ThemeExtension<InfoTheme> {
|
||||
final Color textColor;
|
||||
|
||||
InfoTheme({required this.textColor});
|
||||
|
||||
@override
|
||||
InfoTheme copyWith({Color? textColor}) =>
|
||||
InfoTheme(textColor: textColor ?? this.textColor);
|
||||
|
||||
@override
|
||||
InfoTheme lerp(ThemeExtension<InfoTheme>? other, double t) {
|
||||
if (other is! InfoTheme) {
|
||||
return this;
|
||||
}
|
||||
|
||||
return InfoTheme(
|
||||
textColor: Color.lerp(textColor, other.textColor, t) ?? textColor);
|
||||
}
|
||||
}
|
|
@ -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)
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in a new issue