HuxTabs class

HuxTabs is a customizable tab component that provides a consistent navigation experience with multiple variants and sizes.

The tabs automatically adapt to light and dark themes and provide a clean, modern appearance with proper spacing and accessibility.

Example:

HuxTabs(
  tabs: [
    HuxTabItem(
      label: 'Overview',
      content: Text('Overview content'),
      icon: Icons.dashboard,
    ),
    HuxTabItem(
      label: 'Settings',
      content: Text('Settings content'),
      icon: Icons.settings,
    ),
  ],
  onTabChanged: (index) => print('Tab changed to $index'),
)
Inheritance

Constructors

HuxTabs({Key? key, required List<HuxTabItem> tabs, int initialIndex = 0, HuxTabVariant variant = HuxTabVariant.default_, HuxTabSize size = HuxTabSize.medium, ValueChanged<int>? onTabChanged, bool isScrollable = false, TabAlignment alignment = TabAlignment.start, bool expandContent = false})
Creates a HuxTabs widget.
const

Properties

alignment TabAlignment
Alignment of tabs within the available space
final
expandContent bool
Whether the content should expand to fill available vertical space
final
hashCode int
The hash code for this object.
no setterinherited
initialIndex int
Initial active tab index
final
isScrollable bool
Whether tabs should be scrollable horizontally
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onTabChanged ValueChanged<int>?
Callback when the active tab changes
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size HuxTabSize
Size variant of the tabs
final
tabs List<HuxTabItem>
List of tab items to display
final
variant HuxTabVariant
Visual variant of the tabs
final

Methods

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