feat(layout)!: the shell's content box no longer scrolls; pages scroll themselves - #166
Conversation
…l themselves In a go_router shell the route child is the nested Navigator, so the default 'flex-1 overflow-y-auto' content box scrolled the Navigator and laid its Overlay out under an unbounded height. A page left under a .stacked() route was then never laid out again, and its second rebuild while hidden failed _debugRelayoutBoundaryAlreadyMarkedNeedsLayout in debug and left the tree inconsistent. contentClassName now defaults to 'flex-1 min-h-0' and contentScrollPrimary to false. Every view the package ships already scrolls itself, so none of the starter's own screens moves. A host page that relied on the shell to scroll it needs its own scroll view or MSPageScaffold, or the old pair set back; the CHANGELOG and the layout doc cover both. Closes #160
…ling Review follow-up on the content box change. The notification screens were wrapped in MSPageContainer, whose top and bottom padding sat outside their own scroll view: under a content box that no longer scrolls, that padding inset the viewport and a long list clipped at a hard line. The host geometry now travels as the views' contentClassName, which lands inside their scroll. The starter:install dashboard stub had no scroll at all and now has its own. The CHANGELOG entry moves under a Breaking heading as earlier breaking releases did, names the two screens that changed and the iOS status-bar tap-to-top this loses, and three comments stop describing the shell's scroll container.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
Note Kodizm (AI-generated). May contain mistakes; verify before acting. The change looks correct. I found nothing to fix before merging. The break is deliberate, and the CHANGELOG, the docs and the tests all cover it. I checked these points:
The downstream TestsThere is a new go_router CI
|
magic_starter's app shell stops scrolling its content box (fluttersdk/magic_starter#166): a scroll around the shell's nested Navigator broke a page left under a stacked route. Under the new default a page taller than the window scrolls itself, and this one had no scroll of its own. Under the old default the inner scroll sizes to its content and claims no drag, so this lands safely either way.
What
MagicStarterLayoutTheme.contentClassNamedefaults to'flex-1 min-h-0'andcontentScrollPrimarytofalse(previously'flex-1 overflow-y-auto'andtrue). The shell's content box no longer scrolls, and each routed page scrolls itself.contentClassName, inside their own scroll view, rather than wrapped inMSPageContainer.starter:installdashboard stub gets its own scroll view.doc/basics/views-and-layouts.mdand three comments now describe the new shape. The CHANGELOG has a### Breakingentry with migration steps and one known loss.Why
In a go_router shell the route child is the nested Navigator, so the old default scrolled the Navigator and laid its Overlay out under an unbounded height. A page left under a
.stacked()route was then never laid out again, and its second rebuild while hidden failed_debugRelayoutBoundaryAlreadyMarkedNeedsLayoutin debug and left the tree inconsistent. Closes #160; upstream is flutter/flutter#193247, reproduced in a fresh app, with aSizedBox.expandcontrol that stays clean.Testing
ShellRouteonMagicStarterAppLayout, with a list and a pushed detail, and the hidden list rebuilt three times. Red on the old default with the assertion, green on the new one.flutter analyzeclean, 1552 tests green,dart format --set-exit-if-changed .clean.Downstream
layout.app.DashboardViewhas no scroll view of its own. A matching PR in that repository wraps it.