ColorAnimation constructor
ColorAnimation({
- Key? key,
- required Duration duration,
- required Duration delay,
- required Widget child,
- ValueSetter<
AnimationController> ? onComplete, - required Color begin,
- required Color end,
- Color? idleColor,
Implementation
ColorAnimation({
super.key,
required super.duration,
required super.delay,
required super.child,
super.onComplete,
required Color begin,
required Color end,
Color? idleColor,
}) : super(
builder: (context, value, child) => ColorFiltered(
colorFilter: ColorFilter.mode(
Color.lerp(begin, end, value!.value.toDouble())!,
BlendMode.srcIn,
),
child: child,
),
idleValue: idleColor ?? begin,
tween: ColorTween(begin: begin, end: end),
);