CNTabBarItem class

Immutable data describing a single tab bar item.

Provide at least a label or an icon (or both). Use CNIcon to supply any icon source — SF Symbols, xcasset catalog entries, Flutter asset paths, or raw bytes (PNG/JPG/SVG):

CNTabBarItem(label: 'Home',   icon: CNIcon.symbol('house.fill'))
CNTabBarItem(label: 'Inbox',  icon: CNIcon.asset('assets/inbox.svg'))
CNTabBarItem(label: 'Photos', icon: CNIcon.xcasset('TabPhotos'))

Constructors

CNTabBarItem({String? label, CNIcon? icon, CNIcon? activeIcon, String? badge, Color? badgeColor})
Creates a tab bar item description.
const

Properties

activeIcon CNIcon?
Icon for the selected state. Falls back to icon when not provided.
final
badge String?
Optional badge to display on the tab bar item. Use null for no badge, CNTabBarItem.badgeDot (empty string) for a dot-only indicator, or a non-empty string for badge text (e.g. a count). On iOS, this displays as a red badge; on macOS, badges are not supported.
final
badgeColor Color?
Optional badge background color for this item.
final
hashCode int
The hash code for this object.
no setterinherited
icon CNIcon?
Icon for the unselected state.
final
label String?
Optional tab item label.
final
props List<Object?>
The list of properties that will be used to determine whether two instances are equal.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stringify bool?
If set to true, the toString method will be overridden to output this instance's props.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Constants

badgeDot → const String
Value for badge that shows a dot with no number or text.