Commit 921c0fa5 authored by Adam Barth's avatar Adam Barth Committed by GitHub

Improve and document SliverGrid delegate structure (#7884)

We now create a GridLayout object that memoizes the layout information
for a given SliverConstraints. This approach is both more efficient
(because the delegate no longer needs to re-solve its layout for each
child) and allows for more code sharing between delegates.

The SliverGridRegularTileLayout will also be useful for the date
picker.

Also, document the grid delegates.
parent 7f79cced
......@@ -209,7 +209,7 @@ class SliverGrid extends SliverMultiBoxAdaptorWidget {
lastIndex,
leadingScrollOffset,
trailingScrollOffset,
) ?? gridDelegate.estimateMaxScrollOffset(constraints, delegate.estimatedChildCount);
) ?? gridDelegate.getLayout(constraints).estimateMaxScrollOffset(delegate.estimatedChildCount);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment