DrawerItem class

Data model for a single drawer item.

Constructors

DrawerItem({required String label, String? subtitle, IconData? icon, Widget? trailing, VoidCallback? onTap, bool selected = false, bool enabled = true, bool closeOnTap = true, bool isDivider = false})
Creates a DrawerItem.
const
DrawerItem.divider()
Create a divider item.
const

Properties

closeOnTap → bool
Whether to automatically close the drawer when this item is tapped.
final
enabled → bool
Whether the item is enabled.
final
hashCode → int
The hash code for this object.
no setterinherited
icon → IconData?
Optional icon to display before the label.
final
isDivider → bool
Whether this item is a divider.
final
label → String
The text label to display.
final
onTap → VoidCallback?
Callback when the item is tapped.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selected → bool
Whether the item is currently selected.
final
subtitle → String?
Optional secondary text to display below the label.
final
trailing → Widget?
Optional widget to display after the label.
final

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