defaultLayoutBuilder static method

Widget defaultLayoutBuilder(
  1. Widget? currentChild,
  2. List<Widget> previousChildren

The layout builder used as the default value of layoutBuilder.

The new child is placed in a Stack that sizes itself to match the largest of the child or a previous child. The children are centered on each other.

This is an AnimatedSwitcherLayoutBuilder function.


static Widget defaultLayoutBuilder(Widget? currentChild, List<Widget> previousChildren) {
  return Stack(
    children: <Widget>[
      if (currentChild != null) currentChild,