FSSequentialAnimation.fadeIn constructor

FSSequentialAnimation.fadeIn({
  1. Key? key,
  2. required List<Widget> children,
  3. Duration stepDuration = const Duration(milliseconds: 400),
  4. Duration stepDelay = const Duration(milliseconds: 200),
  5. Curve curve = Curves.easeOut,
  6. bool autoPlay = true,
  7. String? semanticLabel,
  8. VoidCallback? onComplete,
  9. VoidCallback? onStart,
  10. bool respectSystemPreferences = true,
})

Create a simple fade-in sequential animation

Implementation

factory FSSequentialAnimation.fadeIn({
  Key? key,
  required List<Widget> children,
  Duration stepDuration = const Duration(milliseconds: 400),
  Duration stepDelay = const Duration(milliseconds: 200),
  Curve curve = Curves.easeOut,
  bool autoPlay = true,
  String? semanticLabel,
  VoidCallback? onComplete,
  VoidCallback? onStart,
  bool respectSystemPreferences = true,
}) {
  final totalDuration = Duration(
      milliseconds: (stepDuration.inMilliseconds + stepDelay.inMilliseconds) *
          children.length);

  return FSSequentialAnimation(
    key: key,
    children: children,
    sequence: FSAnimationSequence(
      duration: totalDuration,
      curve: curve,
      steps: List<FSAnimationStep>.generate(
        children.length,
        (index) => FSAnimationStep(
          animation: FSAnimation(
            duration: stepDuration,
            curve: curve,
          ),
          delay: Duration(milliseconds: stepDelay.inMilliseconds * index),
        ),
      ),
    ),
    autoPlay: autoPlay,
    semanticLabel: semanticLabel,
    onComplete: onComplete,
    onStart: onStart,
    respectSystemPreferences: respectSystemPreferences,
  );
}