Skip to content

Commit

Permalink
fluttercommunity#75 bugfix: header height is considered when calculat…
Browse files Browse the repository at this point in the history
…ing constraint
  • Loading branch information
Akbarjon Pulatov authored and Akbarjon Pulatov committed Jun 13, 2023
1 parent 0a3239f commit f680301
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/sticky_headers/render.dart
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,11 @@ class RenderStickyHeader extends RenderBox
final width = constraints.constrainWidth(
max(constraints.minWidth, _contentBox.size.width),
);
final height = constraints.constrainHeight(
max(constraints.minHeight, _overlapHeaders ? contentHeight : headerHeight + contentHeight),
);
final height = constraints.constrainHeight([
constraints.minHeight,
headerHeight,
_overlapHeaders ? contentHeight : headerHeight + contentHeight
].reduce(max));
size = Size(width, height);

// place content underneath header
Expand Down

0 comments on commit f680301

Please sign in to comment.