OudsNavigationButton class

OUDS Navigation Button design guidelines

Reference design version : 3.3.0

Navigation Button is a UI element used for navigating between screens or pages in a sequence. It appears in different appearances and states to provide clear directional affordance.

This component is built on top of OudsButton and supports two layouts: This component is implemented as a thin wrapper around OudsButton and shares the same visual states (enabled, disabled, hovered, focused, loading).

Two layouts are available:

When no label is provided, the button renders in icon-only mode. Always supply a semanticsLabel in that case to satisfy accessibility requirements.

Parameters

  • layout: Direction of navigation. Required.
  • appearance: Visual importance of the button. Required.
  • label: Optional text label describing the navigation action.
  • onPressed: Callback invoked on tap. Pass null to disable the button.
  • loader: Optional Loader displaying a loading indicator inside the button.
  • isFullWidth: When true, the button expands to fill the full width. Defaults to false.
  • semanticsLabel: Accessibility label used in icon-only mode when no label is provided.
  • package: Package name to resolve the chevron asset when it comes from a package.

Usage examples:

Next navigation button:

OudsNavigationButton(
  label: 'Next step',
  layout: OudsNavigationButtonLayout.next,
  appearance: OudsNavigationButtonAppearance.defaultAppearance,
  onPressed: () {
    // Navigate to the next screen.
  },
);


**Icon-only navigation button (accessibility label required):**
```dart
OudsNavigationButton(
  layout: OudsNavigationButtonLayout.next,
  appearance: OudsNavigationButtonAppearance.defaultAppearance,
  semanticsLabel: 'Go to next page',
  onPressed: () {},
);
Inheritance

Constructors

OudsNavigationButton({Key? key, String? label, VoidCallback? onPressed, required OudsNavigationButtonLayout layout, required OudsNavigationButtonAppearance appearance, String? package, Loader? loader, bool? isFullWidth, String? semanticsLabel})
const

Properties

appearance OudsNavigationButtonAppearance
final
hashCode int
The hash code for this object.
no setterinherited
isFullWidth bool?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label String?
final
layout OudsNavigationButtonLayout
final
loader Loader?
final
onPressed VoidCallback?
final
package String?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
semanticsLabel String?
final

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