StreamSheetHeader class

A header for bottom sheets, modals, and dialogs in the Stream design system.

StreamSheetHeader arranges an optional centered title (and optional subtitle) between optional leading and trailing widget slots — typically a close button on the leading side and a confirm action on the trailing side.

The heading occupies the flexible center of the row, with the wider of leading / trailing mirrored on the opposite side so the title stays geometrically centred.

When leading is null and automaticallyImplyLeading is true (the default), a dismissal button is inserted if the enclosing route can pop. The icon and behaviour depend on the surface:

  • Inside a standalone StreamSheetRoute (or its nested navigator's first route), a cross (xmark) is shown — pressing it closes the entire sheet.
  • Inside a stacked StreamSheetRoute (one that covers another sheet), a platform-aware back affordance is shown — pressing it pops back to the previous sheet.
  • Inside deeper nested routes within a StreamSheetRoute, a platform-aware back affordance is shown — pressing it pops one level inside the sheet.
  • On any other modal surface (bottom sheets, dialogs, fullscreen dialogs), a cross is shown.
  • On regular pushed pages, a platform-aware back affordance is shown.

The platform-aware back affordance is a chevron on iOS / macOS and an arrow-left on Android / web / desktop.

The drag handle shown on iOS-style bottom sheets is intentionally not part of this widget — the sheet itself owns that affordance, which keeps this header usable for non-sheet surfaces (full-page modals, dialog headers).

{@tool snippet}

Use inside a StreamSheetRoute with a confirm action — the leading close button is auto-implied (cross at the root of a sheet, back affordance when stacked over another sheet):

showStreamSheet<ProfileEdits>(
  context: context,
  builder: (sheetContext, scrollController) => Column(
    mainAxisSize: MainAxisSize.min,
    children: [
      StreamSheetHeader(
        title: const Text('Edit profile'),
        trailing: StreamButton.icon(
          icon: Icon(context.streamIcons.checkmark),
          onPressed: () => Navigator.of(sheetContext).pop(edits),
        ),
      ),
      // ... sheet contents
    ],
  ),
);

{@end-tool}

Theming

StreamSheetHeader uses StreamSheetHeaderThemeData for default styling — padding, spacing, title/subtitle text styles, and per-slot button style propagation. Defaults are derived from StreamColorScheme, StreamTextTheme, and StreamSpacing.

See also:

Inheritance
Implemented types

Constructors

StreamSheetHeader({Key? key, Widget? leading, bool automaticallyImplyLeading = true, Widget? title, Widget? subtitle, Widget? trailing, bool primary = true, bool excludeHeaderSemantics = false, StreamSheetHeaderStyle? style})
Creates a Stream sheet header.

Properties

hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
preferredSize → Size
The size this widget would prefer if it were otherwise unconstrained.
no setteroverride
props → StreamSheetHeaderProps
The properties that configure this header.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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