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({Key? key, Widget? icon, Widget? label, Widget? subtitle, Widget? trailing, required VoidCallback? onPressed, VoidCallback? onLongPress, FocusNode? focusNode, bool autofocus = false})
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
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?
finalinherited
label Widget?
The label to show in the button (primary area) or menu (secondary area)
final
onLongPress VoidCallback?
final
onPressed VoidCallback?
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
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