ArcoDropdownButton class
带下拉菜单的按钮组,对应官方 Dropdown.Button。
结构为一个 ArcoButtonGroup:左侧按钮承载 child 与 onPressed, 右侧按钮显示 icon(默认「更多」图标)并负责展开下拉。
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- ArcoDropdownButton
Constructors
-
ArcoDropdownButton({Key? key, required Widget droplist, required Widget child, ArcoTriggerPosition position = ArcoTriggerPosition.br, Set<
ArcoTriggerType> trigger = const <ArcoTriggerType>{ArcoTriggerType.hover}, ArcoButtonSize size = ArcoButtonSize.medium, ArcoButtonType type = ArcoButtonType.secondary, bool disabled = false, Widget? icon, VoidCallback? onPressed, Duration mouseEnterDelay = const Duration(milliseconds: 400), Duration mouseLeaveDelay = const Duration(milliseconds: 400), ValueChanged<bool> ? onVisibleChange, bool? popupVisible, bool defaultPopupVisible = false}) -
创建带下拉的按钮组。
const
Properties
- child → Widget
-
左侧按钮内容。
final
- defaultPopupVisible → bool
-
非受控初始显示状态。
final
- disabled → bool
-
是否禁用。
final
- droplist → Widget
-
下拉内容。
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → Widget?
-
右侧按钮图标,默认「更多」。
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- mouseEnterDelay → Duration
-
移入延时。
final
- mouseLeaveDelay → Duration
-
移出延时。
final
- onPressed → VoidCallback?
-
左侧按钮点击回调(对应官方
onClick)。final -
onVisibleChange
→ ValueChanged<
bool> ? -
显示状态变化回调。
final
- popupVisible → bool?
-
受控显示状态。
final
- position → ArcoTriggerPosition
-
方位,官方默认
br。final - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- size → ArcoButtonSize
-
与 ArcoButton 一致的尺寸。
final
-
trigger
→ Set<
ArcoTriggerType> -
触发方式。
final
- type → ArcoButtonType
-
与 ArcoButton 一致的类型(对应官方
type="default",即默认灰底按钮)。final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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, int wrapWidth = 65}) → 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