StreamBottomNavBar class

A bottom navigation bar for Stream surfaces.

Floating style

When StreamSurfaceStyle.floating is in effect, the bar renders as a horizontally padded pill with a rounded background, a subtle shadow, and a hairline border. It sits above the body content and is typically used with StreamScaffold's floating bottom slot.

Regular style

When StreamSurfaceStyle.regular is in effect, the bar renders as a standard docked bar with Stream color and typography tokens. A hairline borderSubtle top border separates it from the body.

Behaviour resolution

The effective behaviour is resolved in this priority order:

  1. StreamBottomNavBarStyle.surfaceStyle — set per-instance via style or the ambient StreamBottomNavBarTheme.
  2. The ambient StreamSurfaceStyle — floating maps to a floating pill, regular to a docked bar.

In a StreamScaffold bottom slot, drive floating through the ambient StreamSurfaceStyle (or the scaffold's bottomSurfaceStyle) so the scaffold reserves the matching body inset. Floating set only through StreamBottomNavBarTheme floats the pill without that inset, so content can slide under it.

Theming

Item colors, icon size, label styles, border, and pill radius are resolved from StreamBottomNavBarStyle — set per-instance via style or globally via StreamBottomNavBarTheme, falling back to token-backed defaults.

{@tool snippet}

Basic usage:

StreamBottomNavBar(
  currentIndex: _currentIndex,
  onTap: (i) => setState(() => _currentIndex = i),
  items: const [
    StreamBottomNavBarItem(
      icon: Icon(Icons.chat_bubble_outline),
      selectedIcon: Icon(Icons.chat_bubble),
      label: 'Chats',
    ),
    StreamBottomNavBarItem(
      icon: Icon(Icons.bookmark_outline),
      selectedIcon: Icon(Icons.bookmark),
      label: 'Saved',
    ),
  ],
)

{@end-tool}

See also:

Inheritance

Constructors

StreamBottomNavBar({Key? key, required List<StreamBottomNavBarItem> items, required int currentIndex, required ValueChanged<int> onTap, StreamBottomNavBarStyle? style})
Creates a Stream bottom navigation bar.

Properties

hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
props StreamBottomNavBarProps
The properties that configure this navigation bar.
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

Static Methods

resolveSurfaceStyle(BuildContext context, {StreamBottomNavBarStyle? style}) StreamSurfaceStyle
The surface style this nav bar renders with in context.