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;
|
2023-07-05 18:10:45 +00:00
|
|
|
final Color addressButtonBorderColor;
|
|
|
|
final Color dateSectionRowColor;
|
2023-07-05 12:54:53 +00:00
|
|
|
|
|
|
|
CakeTextTheme(
|
|
|
|
{required this.secondaryTextColor,
|
|
|
|
required this.textfieldUnderlineColor,
|
2023-07-05 18:10:45 +00:00
|
|
|
required this.titleColor,
|
|
|
|
required this.addressButtonBorderColor,
|
|
|
|
required this.dateSectionRowColor});
|
2023-07-05 12:54:53 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
CakeTextTheme copyWith(
|
|
|
|
{Color? secondaryTextColor,
|
|
|
|
Color? textfieldUnderlineColor,
|
2023-07-05 18:10:45 +00:00
|
|
|
Color? titleColor,
|
|
|
|
Color? addressButtonBorderColor,
|
|
|
|
Color? dateSectionRowColor}) =>
|
2023-07-05 12:54:53 +00:00
|
|
|
CakeTextTheme(
|
|
|
|
secondaryTextColor: secondaryTextColor ?? this.secondaryTextColor,
|
|
|
|
textfieldUnderlineColor:
|
|
|
|
textfieldUnderlineColor ?? this.textfieldUnderlineColor,
|
2023-07-05 18:10:45 +00:00
|
|
|
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)!,
|
2023-07-05 18:10:45 +00:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|