mirror of
https://github.com/KRTirtho/spotube.git
synced 2025-09-13 16:05:18 +00:00
35 lines
974 B
Dart
35 lines
974 B
Dart
import 'package:flutter/material.dart';
|
|
|
|
class ShimmerColorTheme extends ThemeExtension<ShimmerColorTheme> {
|
|
final Color? shimmerColor;
|
|
final Color? shimmerBackgroundColor;
|
|
|
|
ShimmerColorTheme({
|
|
this.shimmerBackgroundColor,
|
|
this.shimmerColor,
|
|
});
|
|
|
|
@override
|
|
ThemeExtension<ShimmerColorTheme> copyWith(
|
|
{Color? shimmerColor, Color? shimmerBackgroundColor}) {
|
|
return ShimmerColorTheme(
|
|
shimmerBackgroundColor:
|
|
shimmerBackgroundColor ?? this.shimmerBackgroundColor,
|
|
shimmerColor: shimmerColor ?? this.shimmerColor,
|
|
);
|
|
}
|
|
|
|
@override
|
|
ThemeExtension<ShimmerColorTheme> lerp(
|
|
ThemeExtension<ShimmerColorTheme>? other, double t) {
|
|
if (other is! ShimmerColorTheme) {
|
|
return this;
|
|
}
|
|
return ShimmerColorTheme(
|
|
shimmerBackgroundColor:
|
|
Color.lerp(shimmerBackgroundColor, other.shimmerBackgroundColor, t),
|
|
shimmerColor: Color.lerp(shimmerColor, other.shimmerColor, t),
|
|
);
|
|
}
|
|
}
|