AnimatedCrossFade constructor

const AnimatedCrossFade({Key key, @required Widget firstChild, @required Widget secondChild, Curve firstCurve: Curves.linear, Curve secondCurve: Curves.linear, Curve sizeCurve: Curves.linear, AlignmentGeometry alignment: Alignment.topCenter, @required CrossFadeState crossFadeState, @required Duration duration, Duration reverseDuration, AnimatedCrossFadeBuilder layoutBuilder: defaultLayoutBuilder })

Creates a cross-fade animation widget.

The duration of the animation is the same for all components (fade in, fade out, and size), and you can pass Intervals instead of Curves in order to have finer control, e.g., creating an overlap between the fades.

All the arguments other than key must be non-null.

Implementation

const AnimatedCrossFade({
  Key key,
  @required this.firstChild,
  @required this.secondChild,
  this.firstCurve = Curves.linear,
  this.secondCurve = Curves.linear,
  this.sizeCurve = Curves.linear,
  this.alignment = Alignment.topCenter,
  @required this.crossFadeState,
  @required this.duration,
  this.reverseDuration,
  this.layoutBuilder = defaultLayoutBuilder,
}) : assert(firstChild != null),
     assert(secondChild != null),
     assert(firstCurve != null),
     assert(secondCurve != null),
     assert(sizeCurve != null),
     assert(alignment != null),
     assert(crossFadeState != null),
     assert(duration != null),
     assert(layoutBuilder != null),
     super(key: key);