2023-07-03 20:37:38 +00:00
|
|
|
import 'package:cake_wallet/themes/extensions/indicator_dot_theme.dart';
|
2023-07-03 18:15:58 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
|
|
|
|
class DashboardPageTheme extends ThemeExtension<DashboardPageTheme> {
|
|
|
|
final Color firstGradientBackgroundColor;
|
|
|
|
final Color secondGradientBackgroundColor;
|
|
|
|
final Color thirdGradientBackgroundColor;
|
|
|
|
final Color textColor;
|
|
|
|
|
2023-07-03 20:37:38 +00:00
|
|
|
final IndicatorDotTheme? indicatorDotTheme;
|
|
|
|
|
2023-07-03 18:15:58 +00:00
|
|
|
DashboardPageTheme(
|
|
|
|
{required this.firstGradientBackgroundColor,
|
|
|
|
required this.secondGradientBackgroundColor,
|
|
|
|
required this.thirdGradientBackgroundColor,
|
2023-07-03 20:37:38 +00:00
|
|
|
required this.textColor,
|
|
|
|
this.indicatorDotTheme});
|
2023-07-03 18:15:58 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
DashboardPageTheme copyWith(
|
|
|
|
{Color? firstGradientBackgroundColor,
|
|
|
|
Color? secondGradientBackgroundColor,
|
|
|
|
Color? thirdGradientBackgroundColor,
|
2023-07-03 20:37:38 +00:00
|
|
|
Color? textColor,
|
|
|
|
IndicatorDotTheme? indicatorDotTheme}) =>
|
2023-07-03 18:15:58 +00:00
|
|
|
DashboardPageTheme(
|
|
|
|
firstGradientBackgroundColor:
|
|
|
|
firstGradientBackgroundColor ?? this.firstGradientBackgroundColor,
|
|
|
|
secondGradientBackgroundColor: secondGradientBackgroundColor ??
|
|
|
|
this.secondGradientBackgroundColor,
|
|
|
|
thirdGradientBackgroundColor:
|
|
|
|
thirdGradientBackgroundColor ?? this.thirdGradientBackgroundColor,
|
2023-07-03 20:37:38 +00:00
|
|
|
textColor: textColor ?? this.textColor,
|
|
|
|
indicatorDotTheme: indicatorDotTheme ?? this.indicatorDotTheme);
|
2023-07-03 18:15:58 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
DashboardPageTheme lerp(ThemeExtension<DashboardPageTheme>? other, double t) {
|
|
|
|
if (other is! DashboardPageTheme) {
|
|
|
|
return this;
|
|
|
|
}
|
|
|
|
|
|
|
|
return DashboardPageTheme(
|
|
|
|
firstGradientBackgroundColor: Color.lerp(firstGradientBackgroundColor,
|
|
|
|
other.firstGradientBackgroundColor, t) ??
|
|
|
|
firstGradientBackgroundColor,
|
|
|
|
secondGradientBackgroundColor: Color.lerp(secondGradientBackgroundColor,
|
|
|
|
other.secondGradientBackgroundColor, t) ??
|
|
|
|
secondGradientBackgroundColor,
|
|
|
|
thirdGradientBackgroundColor: Color.lerp(thirdGradientBackgroundColor,
|
|
|
|
other.thirdGradientBackgroundColor, t) ??
|
|
|
|
thirdGradientBackgroundColor,
|
2023-07-03 20:37:38 +00:00
|
|
|
textColor: Color.lerp(textColor, other.textColor, t) ?? textColor,
|
|
|
|
indicatorDotTheme: indicatorDotTheme?.lerp(other.indicatorDotTheme, t));
|
2023-07-03 18:15:58 +00:00
|
|
|
}
|
|
|
|
}
|