ColorAnimation constructor

ColorAnimation({
  1. Key? key,
  2. required Duration duration,
  3. required Duration delay,
  4. required Widget child,
  5. ValueSetter<AnimationController>? onComplete,
  6. required Color begin,
  7. required Color end,
  8. 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),
      );