AnimatedFadeHeightSwitcher.visible constructor
AnimatedFadeHeightSwitcher.visible({
- required bool visible,
- Duration duration = const Duration(milliseconds: 350),
- required Widget child,
- bool forSliver = false,
- Curve? curve,
- double sizeAxisAlignment = -1,
- Axis sizeAxis = Axis.vertical,
- Set<
AnimatedFadeHeightSwitcherEffect> effects = const {AnimatedFadeHeightSwitcherEffect.fade, AnimatedFadeHeightSwitcherEffect.size},
A helper UI that acts as a shortcut when implementing a widget that you want to either display or not performing this widget transition
Implementation
factory AnimatedFadeHeightSwitcher.visible({
required bool visible,
Duration duration = const Duration(milliseconds: 350),
required Widget child,
bool forSliver = false,
Curve? curve,
double sizeAxisAlignment = -1,
Axis sizeAxis = Axis.vertical,
Set<AnimatedFadeHeightSwitcherEffect> effects = const {
AnimatedFadeHeightSwitcherEffect.fade,
AnimatedFadeHeightSwitcherEffect.size
},
}) {
return AnimatedFadeHeightSwitcher(
child: visible ? child : const SizedBox.shrink(),
duration: duration,
curve: Curves.easeOut,
sizeAxisAlignment: sizeAxisAlignment,
forSliver: forSliver,
sizeAxis: sizeAxis,
effects: effects,
);
}