stackLayoutBuilder function
- Alignment alignment = Alignment.center,
- TextDirection? textDirection,
- StackFit fit = StackFit.loose,
- Clip clipBehavior = Clip.hardEdge,
Layout builder for AnimatedSwitcher based on a Stack, with arguments for customizing the layout.
Implementation
AnimatedSwitcherLayoutBuilder stackLayoutBuilder({
Alignment alignment = Alignment.center,
TextDirection? textDirection,
StackFit fit = StackFit.loose,
Clip clipBehavior = Clip.hardEdge,
}) {
return (currentChild, previousChildren) => Stack(
alignment: alignment,
textDirection: textDirection,
fit: fit,
clipBehavior: clipBehavior,
children: <Widget>[
...previousChildren,
if (currentChild != null) currentChild,
],
);
}