getGeometryForChildIndex method

  1. @override
SliverGridGeometry getGeometryForChildIndex(
  1. int index
)
override

The size and position of the child with the given index.

Implementation

@override
SliverGridGeometry getGeometryForChildIndex(int index) {
  if (index == itemCount - 1) {
    return SliverGridGeometry(
        scrollOffset: (index ~/ crossAxisCount) * mainAxisStride,
        crossAxisOffset: 0.0,
        mainAxisExtent: childMainAxisExtent,
        crossAxisExtent: fullCrossAccessExtent);
  }

  return super.getGeometryForChildIndex(index);
}