computeMaxScrollOffset method
The scroll extent needed to fully display all the tiles if there are
childCount
children in total.
The child count will never be null.
Implementation
@override
double computeMaxScrollOffset(int childCount) {
if (childCount == 0) {
return 0.0;
}
if (childCount <= _geometries.length) {
final rectangle = _geometries[childCount - 1];
// print(
// 'computeMaxScrollOffset(childCount=$childCount):'
// ' ${rectangle.bottom}');
return rectangle.bottom;
}
// print(
// 'computeMaxScrollOffset(childCount=$childCount): '
// 'guessing ${(childCount ~/ columns) * columnWidth * 2.0}');
return (childCount ~/ columns) * columnWidth * 2.0;
}