buildChildLayout method

  1. @override
Widget buildChildLayout(
  1. BuildContext context
)
inherited

Subclasses should override this method to build the layout model.

Implementation

@override
Widget buildChildLayout(BuildContext context) {
  if (itemExtent != null) {
    return SliverFixedExtentList(
      delegate: childrenDelegate,
      itemExtent: itemExtent!,
    );
  } else if (itemExtentBuilder != null) {
    return SliverVariedExtentList(
      delegate: childrenDelegate,
      itemExtentBuilder: itemExtentBuilder!,
    );
  } else if (prototypeItem != null) {
    return SliverPrototypeExtentList(
      delegate: childrenDelegate,
      prototypeItem: prototypeItem!,
    );
  }
  return SliverList(delegate: childrenDelegate);
}