PaneItemExpander class

Hierhical navigation item used on NavigationView

Some apps may have a more complex hierarchical structure that requires more than just a flat list of navigation items. You may want to use top-level navigation items to display categories of pages, with children items displaying specific pages. It is also useful if you have hub-style pages that only link to other pages. For these kinds of cases, you should create a hierarchical NavigationView.

Navigation View Hierarchy Labeled

See also:

Inheritance

Constructors

PaneItemExpander({Key? key, required Widget icon, required List<NavigationPaneItem> items, required Widget body, Widget? title, Widget? infoBadge, Widget? trailing = kDefaultTrailing, FocusNode? focusNode, bool autofocus = false, MouseCursor? mouseCursor, ButtonState<Color?>? tileColor, ButtonState<Color?>? selectedTileColor, VoidCallback? onTap, bool initiallyExpanded = false})

Properties

autofocus bool
True if this widget will be selected as the initial focus when no other node in its scope is currently focused.
finalinherited
body Widget
The body of the view attached to this tab
finalinherited
enabled bool
Whether this pane item is disabled.
finalinherited
expanderKey → _PaneItemExpanderKey
final
focusNode FocusNode?
An optional focus node to use as the focus node for this widget.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
icon Widget
The icon used by this item.
finalinherited
infoBadge Widget?
The info badge used by this item
finalinherited
initiallyExpanded bool
Whether the item is initially expanded. Defaults to false
final
itemKey GlobalKey<State<StatefulWidget>>
The key used for the item itself. Useful to find the position and size of the pane item within the screen
latefinalinherited
items List<NavigationPaneItem>
final
key Key?
finalinherited
mouseCursor MouseCursor?
The cursor for a mouse pointer when it enters or is hovering over the widget.
finalinherited
onTap VoidCallback?
Called when the item is tapped, regardless of selected or not
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedTileColor ButtonState<Color?>?
The color of the tile when unselected. If null, NavigationPaneThemeData.tileColor/hovering is used
finalinherited
tileColor ButtonState<Color?>?
The color of the tile when unselected. If null, NavigationPaneThemeData.tileColor is used
finalinherited
title Widget?
The title used by this item. If the display mode is top or compact, this is shown as a tooltip. If it's open, this is shown by the side of the icon.
finalinherited
trailing Widget?
The trailing widget used by this item. If the current display mode is compact, this is not disaplayed
finalinherited

Methods

build(BuildContext context, bool selected, VoidCallback? onPressed, {PaneDisplayMode? displayMode, bool showTextOnTop = true, ValueChanged<PaneItem>? onItemPressed, bool? autofocus, int? itemIndex}) Widget
Used to construct the pane items all around NavigationView. You can customize how the pane items should look like by overriding this method
override
copyWith({Widget? title, Widget? icon, Widget? infoBadge, Widget? trailing, Widget? body, FocusNode? focusNode, bool? autofocus, MouseCursor? mouseCursor, ButtonState<Color?>? tileColor, ButtonState<Color?>? selectedTileColor, VoidCallback? onTap, bool? enabled}) PaneItem
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
toStringShort() String
A brief description of this object, usually just the runtimeType and the hashCode.
inherited

Operators

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

Constants

kDefaultTrailing → const Icon