MotionTabItem class

A single tab item inside a MotionTabBar.

Handles the icon/label animation that happens when the tab becomes selected or unselected. This widget is used internally by MotionTabBar and is not intended to be used directly.

Inheritance

Constructors

MotionTabItem({Key? key, required String? label, required bool selected, required TextStyle textStyle, required Function callbackFunction, bool labelAlwaysVisible = false, Widget? badge, Widget? tabIconWidget, IconData? tabIconData, Color? tabIconColor, double? tabIconSize = 24})
Creates a MotionTabItem.
const

Properties

badge Widget?
Optional badge widget shown on this tab.
final
callbackFunction Function
Callback invoked when the tab is tapped.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label String?
The label of this tab.
final
labelAlwaysVisible bool
Whether the label is always visible (default: only when selected).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selected bool
Whether this tab is currently selected.
final
tabIconColor Color?
Color of the (unselected) tab icon.
final
tabIconData IconData?
Optional IconData used as the tab icon.
final
tabIconSize double?
Size of the (unselected) tab icon.
final
tabIconWidget Widget?
Optional custom widget used as the tab icon.
final
textStyle TextStyle
TextStyle applied to the label.
final

Methods

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