OudsNavigationBarItem class

An OUDS navigation bar item.

An OudsNavigationBarItem represents a single destination displayed in an OUDS bottom navigation component (e.g. OudsNavigationBar on Material, or OudsTabBar on iOS).

Each item consists of an icon, a label, and optionally a badge. Visual appearance can vary depending on selection and the resolved OudsNavigationBarControlState (enabled/hovered/pressed/focused).

Parameters:

Example usage:

OudsNavigationBarItem(
  icon: 'assets/home.svg',
  label: 'Home',
);

With a badge:

OudsNavigationBarItem(
  icon: 'assets/home.svg',
  label: 'Home',
  badge: OudsNavigationBarItemBadge(
    contentDescription: 'Notifications',
    count: 3,
  ),
);

Constructors

OudsNavigationBarItem({required String icon, required String label, OudsNavigationBarItemBadge? badge})
Creates a navigation bar item with an icon, a label, and an optional badge.
const

Properties

badge OudsNavigationBarItemBadge?
Optional badge displayed over the icon.
final
hashCode int
The hash code for this object.
no setterinherited
icon String
Path to the SVG icon asset.
final
label String
Text label of the navigation item.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toBottomNavigationBarItem(BuildContext context, OudsNavigationBarControlState controlState, {required bool isSelected}) BottomNavigationBarItem
Creates a BottomNavigationBarItem for this OudsNavigationBarItem.
toNavigationDestination(BuildContext context, OudsNavigationBarControlState controlState, {required bool isSelected}) Column
Creates the destination widget tree for this OudsNavigationBarItem.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited