mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2025-01-26 20:46:21 +00:00
refactor: primaryTextTheme.labelSmall.decorationColor -> PlaceholderTheme.color
This commit is contained in:
parent
e49c4ea9a8
commit
94b574b2da
6 changed files with 40 additions and 7 deletions
|
@ -1,5 +1,6 @@
|
|||
import 'package:cake_wallet/src/screens/dashboard/widgets/anonpay_transaction_row.dart';
|
||||
import 'package:cake_wallet/src/screens/dashboard/widgets/order_row.dart';
|
||||
import 'package:cake_wallet/themes/extensions/placeholder_theme.dart';
|
||||
import 'package:cake_wallet/utils/responsive_layout_util.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/anonpay_transaction_list_item.dart';
|
||||
import 'package:cake_wallet/view_model/dashboard/order_list_item.dart';
|
||||
|
@ -136,10 +137,7 @@ class TransactionsPage extends StatelessWidget {
|
|||
S.of(context).placeholder_transactions,
|
||||
style: TextStyle(
|
||||
fontSize: 14,
|
||||
color: Theme.of(context)
|
||||
.primaryTextTheme
|
||||
.labelSmall!
|
||||
.decorationColor!),
|
||||
color: Theme.of(context).extension<PlaceholderTheme>()!.color),
|
||||
),
|
||||
);
|
||||
}))
|
||||
|
|
|
@ -6,6 +6,7 @@ import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
|
|||
import 'package:cake_wallet/themes/extensions/menu_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/order_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/placeholder_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/sync_indicator_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
|
||||
|
@ -85,6 +86,10 @@ class BrightTheme extends LightTheme {
|
|||
templateDotterBorderColor: Palette.shadowWhite,
|
||||
secondGradientColor: Palette.pinkFlamingo);
|
||||
|
||||
@override
|
||||
PlaceholderTheme get placeholderTheme =>
|
||||
PlaceholderTheme(color: Colors.white.withOpacity(0.5));
|
||||
|
||||
@override
|
||||
ThemeData get themeData => super.themeData.copyWith(
|
||||
indicatorColor: Colors.white.withOpacity(0.5), // page indicator
|
||||
|
@ -147,7 +152,6 @@ class BrightTheme extends LightTheme {
|
|||
),
|
||||
labelSmall: TextStyle(
|
||||
color: Palette.darkGray, // transaction/trade details titles
|
||||
decorationColor: Colors.white.withOpacity(0.5), // placeholder
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -13,6 +13,7 @@ import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
|
|||
import 'package:cake_wallet/themes/extensions/order_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/picker_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/placeholder_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/support_page_theme.dart';
|
||||
|
@ -156,6 +157,9 @@ class DarkTheme extends ThemeBase {
|
|||
SeedWidgetTheme get seedWidgetTheme =>
|
||||
SeedWidgetTheme(hintTextColor: PaletteDark.darkCyanBlue);
|
||||
|
||||
@override
|
||||
PlaceholderTheme get placeholderTheme => PlaceholderTheme(color: Colors.grey);
|
||||
|
||||
@override
|
||||
ThemeData get themeData => super.themeData.copyWith(
|
||||
indicatorColor: PaletteDark.cyanBlue, // page indicator
|
||||
|
@ -220,7 +224,6 @@ class DarkTheme extends ThemeBase {
|
|||
labelSmall: TextStyle(
|
||||
color:
|
||||
PaletteDark.lightBlueGrey, // transaction/trade details titles
|
||||
decorationColor: Colors.grey, // placeholder
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
20
lib/themes/extensions/placeholder_theme.dart
Normal file
20
lib/themes/extensions/placeholder_theme.dart
Normal file
|
@ -0,0 +1,20 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
class PlaceholderTheme extends ThemeExtension<PlaceholderTheme> {
|
||||
final Color color;
|
||||
|
||||
PlaceholderTheme({required this.color});
|
||||
|
||||
@override
|
||||
PlaceholderTheme copyWith({Color? color}) =>
|
||||
PlaceholderTheme(color: color ?? this.color);
|
||||
|
||||
@override
|
||||
PlaceholderTheme lerp(ThemeExtension<PlaceholderTheme>? other, double t) {
|
||||
if (other is! PlaceholderTheme) {
|
||||
return this;
|
||||
}
|
||||
|
||||
return PlaceholderTheme(color: Color.lerp(color, other.color, t) ?? color);
|
||||
}
|
||||
}
|
|
@ -13,6 +13,7 @@ import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
|
|||
import 'package:cake_wallet/themes/extensions/order_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/picker_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/placeholder_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/support_page_theme.dart';
|
||||
|
@ -157,6 +158,10 @@ class LightTheme extends ThemeBase {
|
|||
SeedWidgetTheme get seedWidgetTheme =>
|
||||
SeedWidgetTheme(hintTextColor: Palette.darkGray);
|
||||
|
||||
@override
|
||||
PlaceholderTheme get placeholderTheme =>
|
||||
PlaceholderTheme(color: PaletteDark.darkCyanBlue);
|
||||
|
||||
@override
|
||||
ThemeData get themeData => super.themeData.copyWith(
|
||||
indicatorColor:
|
||||
|
@ -222,7 +227,6 @@ class LightTheme extends ThemeBase {
|
|||
),
|
||||
labelSmall: TextStyle(
|
||||
color: Palette.darkGray, // transaction/trade details titles
|
||||
decorationColor: PaletteDark.darkCyanBlue, // placeholder
|
||||
),
|
||||
),
|
||||
);
|
||||
|
|
|
@ -12,6 +12,7 @@ import 'package:cake_wallet/themes/extensions/new_wallet_theme.dart';
|
|||
import 'package:cake_wallet/themes/extensions/order_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/picker_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/pin_code_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/placeholder_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/seed_widget_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/send_page_theme.dart';
|
||||
import 'package:cake_wallet/themes/extensions/support_page_theme.dart';
|
||||
|
@ -91,6 +92,8 @@ abstract class ThemeBase {
|
|||
|
||||
SeedWidgetTheme get seedWidgetTheme;
|
||||
|
||||
PlaceholderTheme get placeholderTheme;
|
||||
|
||||
ThemeData get themeData => generatedThemeData.copyWith(
|
||||
primaryColor: primaryColor,
|
||||
cardColor: containerColor,
|
||||
|
@ -115,6 +118,7 @@ abstract class ThemeBase {
|
|||
orderTheme,
|
||||
sendPageTheme,
|
||||
seedWidgetTheme,
|
||||
placeholderTheme,
|
||||
],
|
||||
scrollbarTheme: ScrollbarThemeData(
|
||||
thumbColor: MaterialStateProperty.all(scrollbarTheme.thumbColor),
|
||||
|
|
Loading…
Reference in a new issue