MiuixIcon class

Miuix 风格的图标。对应 Kotlin Icon

单色图标通过 tint 上色(默认取自 MiuixContentColor); 多色图标传 kMiuixTintUnspecified 以禁用上色,或直接通过 child 传入自定义 Widget。

iconchild 二选一:icon 用于 Material 图标字体字形(对应 Kotlin ImageVector/ImageBitmap 输入),child 用于任意自定义 Widget(对应 Kotlin Painter 输入,如多色 Image)。

Inheritance

Constructors

MiuixIcon({Key? key, IconData? icon, MiuixVectorIcon? vector, Widget? child, Color? tint, String? contentDescription, double? size})
const

Properties

child Widget?
自定义图标 Widget(多色图标等)。对应 Kotlin Painter 输入。
final
contentDescription String?
无障碍描述。null 时不包裹 Semantics(装饰性图标)。 对应 Kotlin contentDescription
final
hashCode int
The hash code for this object.
no setterinherited
icon IconData?
Material 图标数据。对应 Kotlin ImageVector / ImageBitmap 输入。
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size double?
图标尺寸。nullicon 路径回退到 MiuixIconDefaults.defaultSizechild 路径保留自身尺寸。对应 Kotlin defaultSizeFor 逻辑。
final
tint Color?
上色颜色。null 时取 MiuixContentColor.of(context); 传 kMiuixTintUnspecified 时不应用任何 tint(多色图标)。
final
vector MiuixVectorIcon?
Miuix 矢量图标(内置 basic / 扩展图标)。对应 Kotlin ImageVector 输入。
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