CommandBarButton class

Buttons are the most common control to put within a CommandBar. They are composed of an (optional) icon and an (optional) label.

Inheritance

Constructors

CommandBarButton({required VoidCallback? onPressed, Key? key, Widget? icon, Widget? label, Widget? subtitle, Widget? trailing, VoidCallback? onLongPress, FocusNode? focusNode, bool autofocus = false, String? tooltip, bool closeAfterClick = true})
Creates a command bar button
const

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
closeAfterClick → bool
Whether the flyout will be closed after an item is tapped.
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 to show in the button (primary area) or menu (secondary area)
final
key → Key?
The key of this item.
finalinherited
label → Widget?
The label to show in the button (primary area) or menu (secondary area)
final
onLongPress → VoidCallback?
The callback to call when the button is long pressed.
final
onPressed → VoidCallback?
The callback to call when the button is pressed.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
subtitle → Widget?
The sub-title to use if this item is shown in the secondary menu
final
tooltip → String?
The tooltip to show when the button is hovered over.
final
trailing → Widget?
The trailing widget to use if this item is shown in the secondary menu
final

Methods

build(BuildContext context, CommandBarItemDisplayMode displayMode) → Widget
Builds the final widget for this display mode for this item. Sub-classes implement this to build the widget that is appropriate for the given display mode.
override
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