Created
October 3, 2022 10:56
-
-
Save vovaklh/8ee52cda2129a72d49b38037cab2c095 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
part of '../theme.dart'; | |
class ThemeColors extends ThemeExtension<ThemeColors> { | |
final Color filterButtonFillColor; | |
const ThemeColors({ | |
required this.filterButtonFillColor, | |
}); | |
@override | |
ThemeExtension<ThemeColors> copyWith({ | |
Color? filterButtonFillColor, | |
}) { | |
return ThemeColors( | |
filterButtonFillColor: | |
filterButtonFillColor ?? this.filterButtonFillColor, | |
); | |
} | |
@override | |
ThemeExtension<ThemeColors> lerp( | |
ThemeExtension<ThemeColors>? other, | |
double t, | |
) { | |
if (other is! ThemeColors) { | |
return this; | |
} | |
return ThemeColors( | |
filterButtonFillColor: | |
Color.lerp(filterButtonFillColor, other.filterButtonFillColor, t)!, | |
); | |
} | |
static get light => ThemeColors( | |
filterButtonFillColor: AppColors.grey, | |
); | |
static get dark => ThemeColors( | |
filterButtonFillColor: AppColors.white, | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment