MSPageScaffold class
The Shared Page Scaffold
The full page treatment for every authenticated screen: a page surface that
paints the whole content viewport, its own vertical scroll, the shared
MSPageContainer geometry, a unified MSPageHeader, and a
mt-6 flex flex-col gap-6 children area for the page's sections.
One scaffold for every page, not one per surface. Settings, profile, teams,
and notifications each grew their own page chrome, and inside the same shell
that read as three different apps: the settings pages centred at one width,
the team and notification pages capped at nothing at all and spread the full
window, and their p-4 lg:p-6 padding sat the header a few pixels off from
every neighbouring page. The geometry now lives in MSPageContainer and
comes from the host, so there is nothing left per page to disagree about.
Scroll ownership
The SingleChildScrollView uses primary: false so it owns its own
implicit scroll controller and never contends with the ambient
PrimaryScrollController (the same fix applied in MagicStarterGuestLayout
for RouteTransition.none scenarios).
Docked footer
With footer set, the header and children scroll inside an expanded area
and the footer sits below it, outside the scroll, in the same
MSPageContainer width and edge margins. It clears the bottom safe area and
rides above the on-screen keyboard (MediaQuery.viewInsets), which is what
a chat composer needs. A docked layout needs a bounded height, as the app
shell provides; without footer the layout is the plain scroll view above.
Pass scrollController to keep a thread pinned to its newest message.
Large title
With largeTitle (or MagicStarterPageHeaderTheme.largeTitle), the header
renders as MSPageHeaderSize.large and collapses into a
MSPageHeaderSize.compact bar pinned over the top of the page once the
large header has scrolled under it, fading back out on the way down. The
bar spans the page edge to edge, outside the container, and is unmounted
while hidden, so the title and actions exist once in the tree whenever the
bar is not on screen. While it is, they exist twice: an action carrying a
GlobalKey cannot be used here. For assistive technology only one of the
two is the page heading at a time: the large title gives up the role while
the bar shows (its text and the subtitle stay readable, as the bar has no
subtitle), and the bar is left out of the semantics tree while it fades out.
Host-owned chrome
Where MagicStarter.pageChrome.hostOwns(context) is true the header draws
only its actions and the host's bar shows the title and back control, so
the scaffold builds the regular scroll area and neither the large title
nor the compact bar, whatever largeTitle says.
Example: sub-page with back
MSPageScaffold(
title: 'Profile',
subtitle: 'Update your personal information',
backLabel: 'Settings',
backFallback: '/settings',
children: [
MSSettingsSection(header: 'Personal', children: [...]),
],
)
Example: top-level page with a header action
MSPageScaffold(
title: 'Notifications',
actions: [markAllAsReadButton],
children: [MSCard(child: notificationList)],
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- MSPageScaffold
- Annotations
Constructors
-
MSPageScaffold({Key? key, required String title, required List<
Widget> children, String? subtitle, List<Widget> ? actions, String? backLabel, String? backFallback, ScrollController? scrollController, bool? largeTitle, String? containerClassName, String? headerClassName}) -
Creates a MSPageScaffold.
const
Properties
-
actions
→ List<
Widget> ? -
Optional trailing header actions forwarded to MSPageHeader.
final
- backFallback → String?
-
The route the back control navigates to, forwarded to MSPageHeader.
final
- backLabel → String?
-
Optional back-affordance label forwarded to MSPageHeader.
final
-
children
→ List<
Widget> -
The page sections to render in the
mt-6 flex flex-col gap-6children area below the header.final - containerClassName → String?
-
Optional className appended to the scrolling area's MSPageContainer, the
same way MSPageContainer.className is appended to the host's page
geometry.
final
-
An optional widget docked below the scrolling area, outside the scroll.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- headerClassName → String?
-
Optional className forwarded to the MSPageHeader the scaffold builds,
appended after the theme's header container class.
final
- isLargeTitle → bool
-
Whether this scaffold uses the large title, resolving the theme default.
no setter
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- largeTitle → bool?
-
Whether the header is a large title that collapses into a compact bar on
scroll.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scrollController → ScrollController?
-
An optional controller for the scrolling area.
final
- subtitle → String?
-
Optional subtitle forwarded to MSPageHeader.
final
- title → String
-
Required page title forwarded to MSPageHeader.
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited