AnimatedSwitcherModifier constructor

const AnimatedSwitcherModifier({
  1. Key? key,
  2. Key? modifierKey,
  3. Widget? child,
  4. required Duration duration,
  5. Duration? reverseDuration,
  6. Curve switchInCurve = Curves.linear,
  7. Curve switchOutCurve = Curves.linear,
  8. AnimatedSwitcherTransitionBuilder transitionBuilder = AnimatedSwitcher.defaultTransitionBuilder,
  9. AnimatedSwitcherLayoutBuilder layoutBuilder = AnimatedSwitcher.defaultLayoutBuilder,
})

Creates an AnimatedSwitcher.

The duration, transitionBuilder, layoutBuilder, switchInCurve, and switchOutCurve parameters must not be null.

Implementation

const AnimatedSwitcherModifier({
  super.key,
  super.modifierKey,
  super.child,
  required this.duration,
  this.reverseDuration,
  this.switchInCurve = Curves.linear,
  this.switchOutCurve = Curves.linear,
  this.transitionBuilder = AnimatedSwitcher.defaultTransitionBuilder,
  this.layoutBuilder = AnimatedSwitcher.defaultLayoutBuilder,
})  : assert(duration != null),
      assert(switchInCurve != null),
      assert(switchOutCurve != null),
      assert(transitionBuilder != null),
      assert(layoutBuilder != null);