Skip to main content
A wrapper around Scaffold that gives every main screen consistent structure: a compact custom app bar, unified back-button behavior, and status-bar brightness control. Source: styled_scaffold.dart — which exports four things:
  • StyledScaffold — the screen shell
  • StyledAppBar — the compact app bar (usable standalone)
  • ScaffoldCloseButton — themed circular close button
  • SystemUiOverlayOverride — status-bar icon brightness for a subtree

Back-button behavior

The scaffold wraps its Scaffold in a PopScope with canPop: false by default: system back gestures and the app-bar back button are intercepted and routed through onLeadingPressed, which defaults to Beamer.of(context).beamToHome(). Set canPop: true for screens stacked over another route (e.g. the session screen over home) so iOS edge-swipe and system back perform a native pop revealing the route beneath.

StyledScaffold API

StyledAppBar

A compact toolbar (ashToolbarHeight = 40, vs. Material’s 56) built on NavigationToolbar inside a SafeArea. Title renders in titleMedium / contrastMedium, centered. When onBackButtonPressed is provided and no custom leading, a BackButton appears. Padding knobs: topPadding (default kToolbarHeight - 40), bottomPadding (0), horizontalPadding (16). Implements preferredSize from its paddings + border + appBarBottom.

ScaffoldCloseButton

40×40 IconButton with Icons.close, surfaceElevated background, contrastMedium foreground — the standard dismiss affordance for modal-style screens.

SystemUiOverlayOverride

Sets status-bar icon brightness via AnnotatedRegion<SystemUiOverlayStyle> — dark icons on light themes, light icons on dark. Pass brightness explicitly when a screen mixes light content with a dark header (or vice versa). Also exported: context.systemUiOverlayStyle for manual use.

Tokens consumed

surfaceBg (via theme), surfaceElevated (border, close button), contrastMedium (title, icons); typography titleMedium.
StyledScaffold depends on the app’s Beamer router for its default back action — it’s the one design-system component with a navigation dependency.