MacosPulldownButton class
A macOS-style pull-down button.
A pull-down button (often referred to as a pull-down menu) is a type of pop-up button that, when clicked, displays a menu containing a list of choices. The menu appears below the button.
Use a pull-down button to present a list of commands.
A pull-down button can either show a title or an icon to describe the contents of the button's menu. If you use an icon, make sure it clearly communicates the button’s purpose.
See also:
- MacosPulldownMenuItem, the class used to represent the menu options.
- MacosPulldownMenuDivider, the class used to represent a horizontal divider for the menu.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- MacosPulldownButton
Constructors
-
MacosPulldownButton({Key? key, required List<
MacosPulldownMenuEntry> ? items, String? title, String? disabledTitle, IconData? icon, VoidCallback? onTap, TextStyle? style, double? itemHeight = _kMenuItemHeight, FocusNode? focusNode, bool autofocus = false, AlignmentGeometry alignment = AlignmentDirectional.centerStart, }) -
Creates a macOS-style pull-down button.
const
Properties
- alignment → AlignmentGeometry
-
Defines how the title is positioned within the button.
final
- autofocus → bool
-
True if this widget will be selected as the initial focus when no other
node in its scope is currently focused.
final
- disabledTitle → String?
-
The text that is displayed when the pull-down 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 → IconData?
-
An icon to use as title for the pull-down button. Makes the pull-down
button behave and render as an icon-button with a caret.
final
- itemHeight → double?
-
If null, then the menu item heights will vary according to each menu
item's intrinsic height.
final
-
items
→ List<
MacosPulldownMenuEntry> ? -
The list of menu entries for the pull-down menu.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
Defines the pulldown menu's alignment relevant to the button.
final
- onTap → VoidCallback?
-
Called when the pull-down button is tapped.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- style → TextStyle?
-
The text style to use for text in the pull-down button and the pull-down
menu that appears when you tap the button.
final
- title → String?
-
The text to display as title for the pull-down button.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< MacosPulldownButton> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of
DiagnosticsNode
objects describing this node's children.inherited -
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
override
-
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
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited