OudsTabBar class

OUDS Tab Bar design guidelines

Reference design version: 1.0.0

The OUDS Tab Bar is a reusable component for switching between top-level views or pages in an application on iOS.

This widget is backed by Cupertino's CupertinoTabBar (iOS-style bottom tab bar) and expects a list of BottomNavigationBarItem built from OUDS destinations (see OudsNavigationBarItem.toBottomNavigationBarItem).

The bar can be opaque or translucent. OudsTabBar default appearance is opaque. If you need a translucent blurred background as specified by OUDS design:

  • Avoid wrapping the body in a SafeArea as the content must scroll behind the bar to be visible through the blur.
  • Set the Scaffold.extendBody property to true.

Example of code:

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

Parameters:

Example usage:

Default tab bar with 3 items:

OudsTabBar(
  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');
  },
);

Tab bar without translucency:

OudsTabBar(
  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

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

Properties

currentIndex int
The index of the initially selected item.
final
hashCode int
The hash code for this object.
no setterinherited
items List<OudsNavigationBarItem>
The list of items displayed in the bar (icons, labels, optional badge).
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onTap ValueChanged<int>?
Callback invoked when a navigation item is tapped.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
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<OudsTabBar>
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