FadeOut constructor

const FadeOut({
  1. Key? key,
  2. Duration duration = const Duration(milliseconds: 1500),
  3. Duration delay = Duration.zero,
  4. bool repeat = false,
  5. bool reverse = true,
  6. Duration? repeatDuration,
  7. required Widget child,
})

A widget that animates its child's opacity from fully visible to fully transparent, creating a fade-out effect.

The FadeOut widget uses an AnimationController to animate the opacity of its child from 1.0 (fully visible) to 0.0 (fully transparent) over a specified duration.

The animation can be delayed using the delay parameter, repeated using the repeat parameter, and reversed using the reverse parameter. The repeatDuration parameter allows specifying a custom duration for each repeat cycle.

Example usage:

FadeOut(
  duration: Duration(seconds: 2),
  delay: Duration(milliseconds: 500),
  repeat: true,
  reverse: true,
  child: Text('Fading out!'),
)

Parameters:

  • duration: The duration of the fade-out animation. Defaults to 1500 milliseconds.
  • delay: The delay before the animation starts. Defaults to zero.
  • repeat: Whether to repeat the animation. Defaults to false.
  • reverse: Whether to reverse the animation when repeating. Defaults to true.
  • repeatDuration: The duration of each repeat cycle. If null, uses duration.
  • child: The widget to animate. This parameter is required.

Implementation

const FadeOut({
  super.key,
  this.duration = const Duration(milliseconds: 1500),
  this.delay = Duration.zero,
  this.repeat = false,
  this.reverse = true,
  this.repeatDuration,
  required this.child,
});