AnimatedBetween.showHide constructor
const
AnimatedBetween.showHide({
- Key? key,
- required bool show,
- required Widget child,
- Duration fadeDuration = defaultFadeDurationShowHide,
- double sizeDurationFactor = defaultSizeDurationFactorShowHide,
- Curve fadeCurve = Curves.easeInOut,
- Curve sizeCurve = defaultSizeCurve,
- Alignment alignment = Alignment.topCenter,
- Clip clipBehavior = Clip.none,
- AnimatedBetweenMode mode = AnimatedBetweenMode.fit,
- bool printDebug = true,
Convenience constructor that animates a single widget in and out.
When show is true the child is animated in; when show is
false the child is treated as null and the box animates down
to zero size. The grow/shrink model described in the class
documentation applies: showing grows, hiding shrinks.
Implementation
const AnimatedBetween.showHide({
super.key,
required bool show,
required Widget child,
this.fadeDuration = defaultFadeDurationShowHide,
this.sizeDurationFactor = defaultSizeDurationFactorShowHide,
this.fadeCurve = Curves.easeInOut,
this.sizeCurve = defaultSizeCurve,
this.alignment = Alignment.topCenter,
this.clipBehavior = Clip.none,
AnimatedBetweenMode mode = AnimatedBetweenMode.fit,
this.printDebug = true,
}) : assert(sizeDurationFactor >= 1.0, 'sizeDurationFactor must be >= 1.0'),
modeLargerChild = mode,
modeShorterChild = AnimatedBetweenMode.fit,
child = show ? child : null;