Skip to content

Commit

Permalink
wip sticky_header let paintOrigin go negative; TODO test, doc; NB req…
Browse files Browse the repository at this point in the history
…uires right paint order
  • Loading branch information
gnprice committed Jan 31, 2025
1 parent ce150ce commit f551610
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/widgets/sticky_header.dart
Original file line number Diff line number Diff line change
Expand Up @@ -595,11 +595,18 @@ class _RenderSliverStickyHeaderList extends RenderSliver with RenderSliverHelper
// even if the (visible part of the) item is smaller than the header,
// and even if the whole child sliver is smaller than the header.

final paintedHeaderSize = calculatePaintOffset(constraints, from: 0, to: headerExtent);
final headerGrowthPlacement =
_widget.headerPlacement._byGrowth(constraints.growthDirection);

geometry = SliverGeometry( // TODO review interaction with other slivers
scrollExtent: geometry.scrollExtent,
layoutExtent: childExtent,
paintExtent: math.max(childExtent, paintedHeaderSize),
paintExtent: math.max(childExtent, headerExtent),
paintOrigin: switch (headerGrowthPlacement) {
_HeaderGrowthPlacement.growthStart => 0,
_HeaderGrowthPlacement.growthEnd =>
math.min(0.0, childExtent - headerExtent),
},
maxPaintExtent: math.max(geometry.maxPaintExtent, headerExtent),
hasVisualOverflow: geometry.hasVisualOverflow
|| headerExtent > constraints.remainingPaintExtent,
Expand Down

0 comments on commit f551610

Please sign in to comment.