NmAdaptiveScaffold class

Adaptive app chrome.

  • phone: top bar + body + bottom bar (≤ 5 destinations) or a drawer;
  • tablet: collapsed sidebar;
  • desktop / wide: expanded sidebar (user can collapse; persisted).

An optional agent panel sits inline on wide screens and slides in as an end drawer elsewhere; ⌘K / Ctrl+K toggles it.

Inheritance

Constructors

NmAdaptiveScaffold({Key? key, required List<NmNavDestination> destinations, required String? selectedId, required ValueChanged<NmNavDestination> onSelect, required Widget body, required Widget logoCompact, required Widget logoWide, String? title, Widget? topBarLeading, List<Widget> topBarActions = const [], bool showTopBar = true, Widget? sidebarFooter(bool collapsed)?, NmSidebarController? sidebarController, Widget agentPanel(BuildContext context, VoidCallback onClose)?, String? agentLabel, NmPhoneNavigation phoneNavigation = NmPhoneNavigation.bottomBar})
Creates an NmAdaptiveScaffold.
const

Properties

agentLabel → String?
Tooltip/label of the top-bar agent button.
final
agentPanel → Widget Function(BuildContext context, VoidCallback onClose)?
Builds the agent panel; onClose hides it.
final
body → Widget
Page content.
final
destinations → List<NmNavDestination>
Navigation destinations in order.
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
logoCompact → Widget
Logo for the collapsed sidebar.
final
logoWide → Widget
Logo for the expanded sidebar.
final
onSelect → ValueChanged<NmNavDestination>
Called when a destination is chosen.
final
phoneNavigation → NmPhoneNavigation
Phone navigation (bottom bar by default; a drawer beyond five destinations).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedId → String?
Id of the current destination.
final
showTopBar → bool
Hides the top bar.
final
sidebarController → NmSidebarController?
Persisted collapsed state of the sidebar.
final
sidebarFooter → Widget? Function(bool collapsed)?
Bottom slot of the sidebar, told whether it is collapsed.
final
title → String?
Top bar title (usually the current destination).
final
topBarActions → List<Widget>
Widgets at the end of the top bar.
final
topBarLeading → Widget?
Replaces the title area of the top bar (e.g. a project picker).
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<NmAdaptiveScaffold>
Creates the mutable state for this widget at a given location in the tree.
override
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

Static Methods

toggleAgent(BuildContext context) → void
Opens or closes the agent panel of the nearest scaffold.

Constants

agentButtonKey → const ValueKey<String>
Key of the top-bar agent button (for tests and tours).