MiuixCheckboxPreference class

带复选框的偏好设置行。对应 Kotlin CheckboxPreference。

MiuixCheckbox 的位置由 checkboxLocation 决定。当 value 为 true 时 复选框处于选中态。点击整行会触发 onChanged 并切换 value。 复选框本身也可独立交互(当 onChanged 非空且 enabled 为 true 时)。

Inheritance

Constructors

MiuixCheckboxPreference({Key? key, required String title, required bool value, required ValueChanged<bool>? onChanged, MiuixBasicComponentColors? titleColor, String? summary, MiuixBasicComponentColors? summaryColor, MiuixCheckboxColors? checkboxColors, Widget? startAction, List<Widget>? endActions, MiuixCheckboxLocation checkboxLocation = MiuixCheckboxLocation.start, Widget? bottomAction, EdgeInsetsGeometry insideMargin = MiuixBasicComponentDefaults.insideMargin, bool holdDownState = false, bool enabled = true})
const

Properties

bottomAction → Widget?
底部内容(可选),位于主行下方。
final
checkboxColors → MiuixCheckboxColors?
复选框颜色;为 null 时取 MiuixCheckboxDefaults.checkboxColors。
final
checkboxLocation → MiuixCheckboxLocation
复选框位置,默认 MiuixCheckboxLocation.start。
final
enabled → bool
是否启用。
final
endActions → List<Widget>?
末尾额外内容(可选);位于复选框之前,带 8dp 末端间距。
final
hashCode → int
The hash code for this object.
no setterinherited
holdDownState → bool
是否处于按压态(用于外部强制按下视觉效果)。
final
insideMargin → EdgeInsetsGeometry
内边距,默认 MiuixBasicComponentDefaults.insideMargin。
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onChanged → ValueChanged<bool>?
状态变更回调;为 null 时复选框与行均不可交互。
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
startAction → Widget?
起始侧额外内容(可选);位于复选框之后,带 5dp 末端间距。
final
summary → String?
行摘要(可选)。
final
summaryColor → MiuixBasicComponentColors?
摘要颜色;为 null 时取 MiuixBasicComponentDefaults.summaryColor。
final
title → String
行标题。
final
titleColor → MiuixBasicComponentColors?
标题颜色;为 null 时取 MiuixBasicComponentDefaults.titleColor。
final
value → bool
当前复选框状态。
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