pub enum NavPlacement {
Bottom,
Rail,
}Expand description
Where a Scaffold’s navigation destinations are drawn.
A fixed choice: whichever is asked for is what gets drawn, at every width. A
Scaffold never changes its own layout, which is the point of this type existing
(milestone 305).
Until then the scaffold measured its own width and swapped a bottom bar for a side rail above a threshold, with no way to ask it not to. Rotating a phone to landscape crosses that threshold — so the navigation moved from the bottom of the screen to the left edge because the user turned their hand, and nothing in the application had asked for that or could prevent it.
The reference does not do this either: its screen shell has one navigation slot, at the bottom, and a rail is a separate widget placed by whoever wants one. Adapting is a design decision, and it belongs to the application.
For navigation that does follow the size class, reach for
NavScaffold — a separate shell whose whole purpose is that,
and which says so in its name.
Variants§
Bottom
A bottom bar, at every width. The default.
Rail
A vertical rail on the leading edge, at every width.