PaneItem class

The item used by NavigationView to display the tiles.

On PaneDisplayMode.compact, only icon is displayed, and title is used as a tooltip. On the other display modes, icon and title are displayed in a Row.

This is the only NavigationPaneItem that is affected by NavigationIndicators

See also:

Inheritance
Implementers

Constructors

PaneItem({Key? key, required Widget icon, required Widget body, Widget? title, Widget? trailing, Widget? infoBadge, FocusNode? focusNode, bool autofocus = false, MouseCursor? mouseCursor, ButtonState<Color?>? tileColor, ButtonState<Color?>? selectedTileColor, VoidCallback? onTap, bool enabled = true})
Creates a pane item.

Properties

autofocus bool
True if this widget will be selected as the initial focus when no other node in its scope is currently focused.
final
body Widget
The body of the view attached to this tab
final
enabled bool
Whether this pane item is disabled.
final
focusNode FocusNode?
An optional focus node to use as the focus node for this widget.
final
hashCode int
The hash code for this object.
no setterinherited
icon Widget
The icon used by this item.
final
infoBadge Widget?
The info badge used by this item
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
key Key?
finalinherited
mouseCursor MouseCursor?
The cursor for a mouse pointer when it enters or is hovering over the widget.
final
onTap VoidCallback?
Called when the item is tapped, regardless of selected or not
final
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
final
tileColor ButtonState<Color?>?
The color of the tile when unselected. If null, NavigationPaneThemeData.tileColor is used
final
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.
final
trailing Widget?
The trailing widget used by this item. If the current display mode is compact, this is not disaplayed
final

Methods

build(BuildContext context, bool selected, VoidCallback? onPressed, {PaneDisplayMode? displayMode, bool showTextOnTop = true, int? itemIndex, bool? autofocus}) Widget
Used to construct the pane items all around NavigationView. You can customize how the pane items should look like by overriding this method
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
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