Sidebar
Navigation sidebar with collapsible sections.
File: example/lib/widgets/sidebar.dart
Factory Methods
FBSidebar.basic()- Simple sidebar menuFBSidebar.collapsible()- Collapsible menu itemsFBSidebar.icon()- Icon-based sidebarFBSidebar.drawer()- Drawer style sidebar
Properties
items: List<SidebarItem>
onItemTap: Function(int)
selectedIndex: int
backgroundColor: Color
expandedWidth: double
collapsedWidth: double
Usage Example
Scaffold(
drawer: FBSidebar.collapsible(
items: [
SidebarItem(label: 'Home', icon: Icons.home),
SidebarItem(label: 'Profile', icon: Icons.person),
SidebarItem(label: 'Settings', icon: Icons.settings),
],
onItemTap: (index) => navigateTo(index),
),
)
With Sub-Items
FBSidebar.collapsible(
items: [
SidebarItem(label: 'Dashboard', icon: Icons.dashboard),
SidebarItem(
label: 'Components',
icon: Icons.widgets,
children: [
SidebarItem(label: 'Buttons'),
SidebarItem(label: 'Forms'),
SidebarItem(label: 'Cards'),
],
),
],
)