DropDownButton class
A dropdown button is a button that shows a chevron as a visual indicator that it has an attached flyout that contains more options. It has the same behavior as a standard Button control with a flyout; only the appearance is different.
See also:
- Flyout, a light dismiss container that can show arbitrary UI as its content. Used to back this button
- ComboBox, a list of items that a user can select from
- docs.microsoft.com/en-us/windows/apps/design/controls/buttons#create-a-drop-down-button
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- DropDownButton
- Available Extensions
Constructors
-
DropDownButton({Key? key, DropDownButtonBuilder? buttonBuilder, required List<
MenuFlyoutItemBase> items, Widget? leading, Widget? title, Widget? trailing = _kDefaultDropdownButtonTrailing, double verticalOffset = _kVerticalOffset, bool closeAfterClick = true, bool disabled = false, FocusNode? focusNode, bool autofocus = false, FlyoutPlacementMode placement = FlyoutPlacementMode.bottomCenter, VoidCallback? onOpen, VoidCallback? onClose, FlyoutTransitionBuilder transitionBuilder = _defaultTransitionBuilder}) -
Creates a dropdown 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
-
A builder for the button. If null, a Button with leading, title and
trailing is used.
final
- closeAfterClick → bool
-
Whether the flyout will be closed after an item is tapped.
final
- disabled → bool
-
If
true
, the button won't be clickable.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
-
items
→ List<
MenuFlyoutItemBase> -
The items in the flyout. Must not be empty
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leading → Widget?
-
The content at the start of this widget.
final
-
The menu color. If null, FluentThemeData.menuColor is used
final
-
The menu shape
final
- onClose → VoidCallback?
-
Called when the flyout is closed
final
- onOpen → VoidCallback?
-
Called when the flyout is opened
final
- placement → FlyoutPlacementMode
-
The placement of the flyout.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- title → Widget?
-
Title show a content at the center of this widget.
final
- trailing → Widget?
-
Trailing show a content at the right of this widget.
final
- transitionBuilder → FlyoutTransitionBuilder
-
final
- verticalOffset → double
-
The space between the button and the flyout.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< DropDownButton> -
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