public override float computeMaxScrollOffset(int childCount) { if (childCount == 0) { return(0.0f); } int rowCount = ShrineHomeUtils._rowAtIndex(childCount - 1) + 1; float?rowSpacing = this.rowStride - this.tileHeight; return((this.rowStride * rowCount - rowSpacing) ?? 0.0f); }
public override SliverGridGeometry getGeometryForChildIndex(int index) { int row = ShrineHomeUtils._rowAtIndex(index); int column = ShrineHomeUtils._columnAtIndex(index); int columnSpan = ShrineHomeUtils._columnSpanAtIndex(index); return(new SliverGridGeometry( scrollOffset: row *this.rowStride, crossAxisOffset: column * this.columnStride, mainAxisExtent: this.tileHeight, crossAxisExtent: this.tileWidth + (columnSpan - 1) * this.columnStride )); }