MiuixBasicComponent class

广泛用于扩展组件的 Miuix 基础行。对应 Kotlin BasicComponent

可直接传入 title/summary,也可用 content 替换中心内容。存在起始或 结束操作时,内部 RenderBox 会先测量起始项,再把“剩余宽度减 8”中的最多 60% 分给结束项,余量交给中心项;这正是源组件防止溢出破坏 2:5:3 布局的 测量方式,而不是普通 Row + Expanded

Inheritance

Constructors

MiuixBasicComponent({Key? key, String? title, MiuixBasicComponentColors? titleColor, String? summary, MiuixBasicComponentColors? summaryColor, Widget? startAction, List<Widget>? endActions, Widget? bottomAction, EdgeInsetsGeometry insideMargin = MiuixBasicComponentDefaults.insideMargin, VoidCallback? onClick, String? onClickLabel, MiuixBasicComponentRole? role, bool holdDownState = false, bool enabled = true, List<Widget>? content})
const

Properties

bottomAction Widget?
final
content List<Widget>?
自定义中心内容;为 null 时由 titlesummary 构建。
final
enabled bool
final
endActions List<Widget>?
final
hashCode int
The hash code for this object.
no setterinherited
holdDownState bool
final
insideMargin EdgeInsetsGeometry
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onClick VoidCallback?
final
onClickLabel String?
final
role MiuixBasicComponentRole?
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
startAction Widget?
final
summary String?
final
summaryColor MiuixBasicComponentColors?
final
title String?
final
titleColor MiuixBasicComponentColors?
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