Skip to content

SliverMainAxisGroup + pinned headers overlap (no push-off) in 3.38.x, works in 3.35.x #178973

@silvershort

Description

@silvershort

Steps to reproduce

Summary

In Flutter 3.38.x, a SliverMainAxisGroup containing nested SliverMainAxisGroups with SliverPersistentHeader(pinned: true) stops pushing the previous header out of view. The new header “dives under” the
previous one instead of replacing it. The same layout works correctly on 3.35.x and earlier.

Environment

  • Flutter: 3.38.3 (stable) — bug reproduces
  • Flutter: 3.35.7 (stable) — works as expected
  • Dart: 3.10.1 (3.38), 3.8.x (3.35)
  • Platform tested: iOS Simulator (iPhone 16 Pro)

Minimal reproduction

DartPad repro: [paste the DartPad link here]

Key structure:

  • CustomScrollView
  • outer SliverMainAxisGroup
    • SliverPersistentHeader(pinned: true) for Year A
    • inner SliverMainAxisGroup
      • SliverPersistentHeader(pinned: true) for Month a1
      • SliverList
      • SliverPersistentHeader(pinned: true) for Month a2
      • SliverList
  • Next year section follows.

Steps to reproduce

  1. Run the DartPad sample on Flutter 3.38.3 (stable).
  2. Scroll so Month A1 content scrolls away and Month A2 header should replace it.
  3. Observe that the incoming header overlaps/slots under the previous header instead of pushing it off.
  4. Repeat on Flutter 3.35.7 — headers push off correctly.

Videos

  • 3.38.3 (bug):
3.38.mov
  • 3.35.7 (correct):
3.35.mov

Additional notes

  • Tried replacing SliverPersistentHeader with PinnedHeaderSliver; the overlap still occurs on 3.38.x.
  • ScrollOffsetCorrection changes and PinnedHeaderSliver fixes in 3.38 were suspected, since the regression is only between 3.35.x → 3.38.x.

Expected results

Expected behavior

When a new pinned header enters, it should push the previous pinned header off-screen (standard sticky behavior).

Actual results

Actual behavior

On 3.38.x, the new header overlaps/overdraws the previous header; it does not push it away.

Code sample

https://dartpad.dev/bc460238c9a5abd2802f9d3a1daaf4fe

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: regressionIt was better in the past than it is nowf: material designflutter/packages/flutter/material repository.f: scrollingViewports, list views, slivers, etc.found in release: 3.38Found to occur in 3.38found in release: 3.39Found to occur in 3.39frameworkflutter/packages/flutter repository. See also f: labels.has reproducible stepsThe issue has been confirmed reproducible and is ready to work onr: fixedIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamtriaged-frameworkTriaged by Framework team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions