Commit 0bcecef5 authored by Adam Barth's avatar Adam Barth Committed by GitHub

Convert ShrineHome to use CustomScrollView (#7887)

This patch converts the Shrine home page to using a sliver-based grid.
This required using a CustomScrollView to mix the block at the top with
the grid below.
parent 921c0fa5
......@@ -24,10 +24,10 @@ import 'sliver_multi_box_adaptor.dart';
class SliverGridGeometry {
/// Creates an object that describes the placement of a child in a [RenderSliverGrid].
const SliverGridGeometry({
this.scrollOffset,
this.crossAxisOffset,
this.mainAxisExtent,
this.crossAxisExtent,
@required this.scrollOffset,
@required this.crossAxisOffset,
@required this.mainAxisExtent,
@required this.crossAxisExtent,
});
/// The scroll offset of the leading edge of the child relative to the leading
......@@ -195,7 +195,7 @@ class SliverGridRegularTileLayout extends SliverGridLayout {
double estimateMaxScrollOffset(int childCount) {
if (childCount == null)
return null;
final int mainAxisCount = ((childCount - 1) / crossAxisCount).floor() + 1;
final int mainAxisCount = ((childCount - 1) ~/ crossAxisCount) + 1;
final double mainAxisSpacing = mainAxisStride - childMainAxisExtent;
return mainAxisStride * mainAxisCount - mainAxisSpacing;
}
......
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