OudsNavigationBar class

OUDS Navigation Bar design guidelines

Reference design version: 1.0.0

The Navigation bar (aka Bottom navigation bar on Material 2) provides access to an app’s primary destinations using 3 to 5 persistent tabs. Each destination is represented by an icon and optionally a text label. Positioned at the bottom of the screen, it supports quick switching between top-level sections, following Material Design navigation patterns.

This widget is backed by the Material 3 NavigationBar (Android/Material-style bottom navigation) and expects a list of destination widgets built from OUDS items (see OudsNavigationBarItem.toNavigationDestination).

The bar can be opaque or translucent. OudsNavigationBar default appearance is opaque but, if you need a translucent blurred as specified on OUDS design side. To do this, use OudsNavigationBar with translucent parameter set to true and :

Example of code:

return Scaffold(
  extendBody: true,
  bottomNavigationBar: OudsNavigationBar(...),
  body: MyScrollableContent(),
);

Parameters:

Example usage:

Default navigation bar with 3 items:

OudsNavigationBar(
  destinations: [
    OudsNavigationBarItem(icon: 'assets/home.svg', label: 'Home'),
    OudsNavigationBarItem(icon: 'assets/search.svg', label: 'Search'),
    OudsNavigationBarItem(icon: 'assets/profile.svg', label: 'Profile'),
  ],
  selectedIndex: 0,
  translucent: true,
  onDestinationSelected: (index) {
    print('Selected item: $index');
  },
);

Navigation bar without translucency:

OudsNavigationBar(
  destinations: [
    OudsNavigationBarItem(icon: 'assets/home.svg', label: 'Home'),
    OudsNavigationBarItem(icon: 'assets/search.svg', label: 'Search'),
  ],
  selectedIndex: 0,
  translucent: false,
  onDestinationSelected: (index) {
    print('Selected item: $index');
  },
);
Inheritance

Constructors

OudsNavigationBar({Key? key, required List<OudsNavigationBarItem> destinations, bool translucent = false, int selectedIndex = 0, ValueChanged<int>? onDestinationSelected})
Creates an OUDS Navigation Bar with configurable items, transparency, and callbacks.
const

Properties

destinations → List<OudsNavigationBarItem>
The list of items displayed in the bar (icons, labels, optional badge).
final
hashCode → int
The hash code for this object.
no setterinherited
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onDestinationSelected → ValueChanged<int>?
Callback invoked when a navigation item is tapped.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectedIndex → int
The index of the initially selected item.
final
translucent → bool
If true, the navigation bar has a translucent background.
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → State<OudsNavigationBar>
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