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) {
  // print('getGeometryForChildIndex($index), cached=${_geometries.length}');
  final rect = (index < _geometries.length)
      ? _geometries[index]
      : _calculateGeometry(index);
  return SliverGridGeometry(
    scrollOffset: rect.top,
    crossAxisOffset: rect.left,
    mainAxisExtent: rect.height,
    crossAxisExtent: rect.width,
  );
}