AnimatedCrossFade constructor
- 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,
- bool excludeBottomFocus = true,
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.
Implementation
const AnimatedCrossFade({
super.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,
this.excludeBottomFocus = true,
});