MiuixDropdownImpl class

下拉选项行的渲染实现。对应 Kotlin DropdownImpl(含旧 SpinnerItemImpl)。

本组件仅负责单行的呈现与点击;弹层、触发器与级联子菜单在独立文件中。

Inheritance

Constructors

MiuixDropdownImpl({Key? key, required MiuixDropdownItem item, required int optionSize, required bool isSelected, required int index, required ValueChanged<int> onSelectedIndexChange, MiuixDropdownColors? dropdownColors, bool? enabled, bool dialogMode = false, bool hasSubmenu = false, bool? isFirst, bool? isLast})
MiuixDropdownItem 渲染一行。
const
MiuixDropdownImpl.text({Key? key, required String text, required int optionSize, required bool isSelected, required int index, required ValueChanged<int> onSelectedIndexChange, MiuixDropdownColors? dropdownColors, bool enabled = true, bool dialogMode = false})
文本便捷构造,对应 Kotlin 第二个 DropdownImpl(text, ...) 重载。

Properties

dialogMode bool
对话框模式。
final
行配色。null 时取 MiuixDropdownDefaults.dropdownColors
final
enabled bool
是否可点击。默认取 item.enabled。
no setter
hashCode int
The hash code for this object.
no setterinherited
hasSubmenu bool
是否作为子菜单触发器。
final
index int
当前项下标。
final
isFirst bool
是否为整个弹层的首行。默认 index == 0
no setter
isLast bool
是否为整个弹层的末行。默认 index == optionSize - 1
no setter
isSelected bool
是否选中。
final
item MiuixDropdownItem
当前选项的数据。
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onSelectedIndexChange ValueChanged<int>
选中回调,以 index 触发。
final
optionSize int
选项总数。
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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