MiuixDropdownItem class

下拉/微调器/下拉菜单中的一项。对应 Kotlin DropdownItem(旧名 SpinnerEntry)。

children 非空且非空列表时,此项成为子菜单触发器:级联弹层会渲染尾部箭头 并在点击时展开子弹层(递归);此时 onClick 被级联层消费而忽略。

Annotations

Constructors

MiuixDropdownItem({required String text, bool enabled = true, bool selected = false, VoidCallback? onClick, Widget? icon, String? summary, List<MiuixDropdownItem>? children})
常规构造。text 为显示文本,enabled 控制是否可点击, selected 标记选中态,onClick 为点击回调,icon 为前置图标, summary 为标题下方的摘要,children 为可选子菜单项。
const
MiuixDropdownItem.spinner({Widget? icon, String? title, String? summary})
兼容旧 SpinnerEntry 的构造:以 title(可空,空则回退空串)作为文本。
const

Properties

children List<MiuixDropdownItem>?
可选子菜单项。非空且非空列表时此项成为子菜单触发器。
final
enabled bool
是否可点击。
final
hashCode int
The hash code for this object.
no setteroverride
icon Widget?
前置图标(调用方提供的任意 Widget)。对应 Kotlin @Composable (Modifier) -> Unit
final
onClick VoidCallback?
点击回调。当 children 非空且非空列表时被级联层消费而忽略。
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selected bool
是否处于选中态。
final
summary String?
标题下方的摘要文本。
final
text String
项显示的文本。
final

Methods

copyWith({String? text, bool? enabled, bool? selected, VoidCallback? onClick, Widget? icon, String? summary, List<MiuixDropdownItem>? children}) MiuixDropdownItem
复制此对象并覆盖部分字段。对应 Kotlin data class copy(...)
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
override