ArnaPopupMenuButton<T> class
Displays a menu when pressed and calls onSelected when the menu is dismissed because an item was selected. The value passed to onSelected is the value of the selected menu item.
See also:
- ArnaPopupMenuItem, a popup menu entry for a single value.
- ArnaPopupMenuDivider, a popup menu entry that is just a horizontal line.
- showArnaMenu, a method to dynamically show a popup menu at a given location.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ArnaPopupMenuButton
Constructors
-
ArnaPopupMenuButton({Key? key, required ArnaPopupMenuItemBuilder<
T> itemBuilder, IconData? icon, T? initialValue, ArnaPopupMenuItemSelected<T> ? onSelected, ArnaPopupMenuCanceled? onCanceled, Offset offset = Offset.zero, bool enabled = true, String? tooltipMessage, ButtonType buttonType = ButtonType.normal, bool isFocusable = true, bool autofocus = false, Color? accentColor, MouseCursor cursor = MouseCursor.defer, String? semanticLabel, ArnaPopupMenuPosition position = ArnaPopupMenuPosition.under}) -
Creates a button that shows a popup menu.
const
Properties
- accentColor → Color?
-
The color of the button's focused border.
final
- autofocus → bool
-
Whether this button should focus itself if nothing else is already focused.
final
-
The type of the button.
final
- cursor → MouseCursor
-
The cursor for a mouse pointer when it enters or is hovering over the button.
final
- enabled → bool
-
Whether this button is interactive.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → IconData?
-
The icon of the button.
final
- initialValue → T?
-
The value of the menu item, if any, that should be highlighted when the menu opens.
final
- isFocusable → bool
-
Whether this button is focusable or not.
final
-
itemBuilder
→ ArnaPopupMenuItemBuilder<
T> -
Called when the button is pressed to create the items to show in the menu.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- offset → Offset
-
The offset is applied relative to the initial position set by the position.
final
- onCanceled → ArnaPopupMenuCanceled?
-
Called when the user dismisses the popup menu without selecting an item.
final
-
onSelected
→ ArnaPopupMenuItemSelected<
T> ? -
Called when the user selects a value from the popup menu created by this button.
final
- position → ArnaPopupMenuPosition
-
Whether the popup menu is positioned over or under the popup menu button.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- semanticLabel → String?
-
The semantic label of the button.
final
- tooltipMessage → String?
-
Text that describes the action that will occur when the button is pressed.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → ArnaPopupMenuButtonState< T> -
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.
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
-
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