SideBarIndicatorStyle enum
Sidebar model contains two icon data and string for the text main Icon can't be null but unselected icon can be null and in this case it will be the main Icon Sidebar model Represents a single item in the sidebar menu.
Each SSideBarItem defines a menu option with icons, text, optional badges, tooltips, and tap callbacks. Items can display different icons when selected vs unselected, and support notification badges.
Basic Usage
SSideBarItem(
iconSelected: Icons.home,
iconUnselected: Icons.home_outlined,
title: 'Home',
tooltip: 'Go to Home',
badgeText: '3', // Optional notification badge
badgeColor: Colors.red,
onTap: (offset) {
print('Home tapped at position: $offset');
},
)
Badge Support
Items can display notification badges to show counts or status:
SSideBarItem(
iconSelected: Icons.notifications,
title: 'Notifications',
badgeText: '5',
badgeColor: Colors.red.shade400,
badgeTextStyle: TextStyle(
color: Colors.white,
fontSize: 10,
fontWeight: FontWeight.bold,
),
)
Icon States
Use different icons for selected and unselected states:
SSideBarItem(
iconSelected: Icons.favorite, // Filled when selected
iconUnselected: Icons.favorite_border, // Outlined when not selected
title: 'Favorites',
)
Style of the active item selection indicator in the sidebar.
Values
- none → const SideBarIndicatorStyle
-
No vertical line indicator, relies on background highlighting.
- leftLine → const SideBarIndicatorStyle
-
Vertical indicator line on the left edge.
- rightLine → const SideBarIndicatorStyle
-
Vertical indicator line on the right edge.
- pill → const SideBarIndicatorStyle
-
No line, but uses a full pill-shaped highlighted background.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- index → int
-
A numeric identifier for the enumerated value.
no setterinherited
- name → String
-
Available on Enum, provided by the EnumName extension
The name of the enum value.no setter - runtimeType → Type
-
A representation of the runtime type of the object.
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
-
values
→ const List<
SideBarIndicatorStyle> - A constant List of the values in this enum, in order of their declaration.