cake_wallet/lib/themes/extensions/cake_text_theme.dart

51 lines
1.8 KiB
Dart
Raw Normal View History

2023-07-05 12:54:53 +00:00
import 'package:flutter/material.dart';
class CakeTextTheme extends ThemeExtension<CakeTextTheme> {
final Color secondaryTextColor;
final Color textfieldUnderlineColor;
final Color titleColor;
final Color addressButtonBorderColor;
final Color dateSectionRowColor;
2023-07-05 12:54:53 +00:00
CakeTextTheme(
{required this.secondaryTextColor,
required this.textfieldUnderlineColor,
required this.titleColor,
required this.addressButtonBorderColor,
required this.dateSectionRowColor});
2023-07-05 12:54:53 +00:00
@override
CakeTextTheme copyWith(
{Color? secondaryTextColor,
Color? textfieldUnderlineColor,
Color? titleColor,
Color? addressButtonBorderColor,
Color? dateSectionRowColor}) =>
2023-07-05 12:54:53 +00:00
CakeTextTheme(
secondaryTextColor: secondaryTextColor ?? this.secondaryTextColor,
textfieldUnderlineColor:
textfieldUnderlineColor ?? this.textfieldUnderlineColor,
titleColor: titleColor ?? this.titleColor,
addressButtonBorderColor:
addressButtonBorderColor ?? this.addressButtonBorderColor,
dateSectionRowColor: dateSectionRowColor ?? this.dateSectionRowColor);
2023-07-05 12:54:53 +00:00
@override
CakeTextTheme lerp(ThemeExtension<CakeTextTheme>? other, double t) {
if (other is! CakeTextTheme) {
return this;
}
return CakeTextTheme(
secondaryTextColor:
Color.lerp(secondaryTextColor, other.secondaryTextColor, t)!,
textfieldUnderlineColor: Color.lerp(
textfieldUnderlineColor, other.textfieldUnderlineColor, t)!,
titleColor: Color.lerp(titleColor, other.titleColor, t)!,
addressButtonBorderColor: Color.lerp(
addressButtonBorderColor, other.addressButtonBorderColor, t)!,
dateSectionRowColor:
Color.lerp(dateSectionRowColor, other.dateSectionRowColor, t)!);
2023-07-05 12:54:53 +00:00
}
}