buildViewport method

Widget buildViewport(
  1. BuildContext context,
  2. ViewportOffset offset
)

Implementation

Widget buildViewport(BuildContext context, ViewportOffset offset) {
  List<Widget> $children = children;
  final spacingWidget =
      this.spacingWidget ??
      (spacing != null ? SizedBox(height: spacing) : null);

  if (spacingWidget != null) {
    final List<Widget> newList = [];
    for (int i = 0; i < $children.length; i++) {
      newList.add($children[i]);
      newList.add(spacingWidget);
    }
    if (newList.isNotEmpty) newList.removeLast();
    $children = newList;
  }

  return _ViewportWidget(
    offset: offset,
    clipBehavior: clipBehavior,
    center: center,
    padding: padding == null ? EdgeInsets.zero : padding as EdgeInsets,
    excludeSemantics: excludeSemantics,
    debugLabel: debugLabel,
    children: $children,
  );
}