MiuixRadioButtonPreference class

带单选按钮的偏好设置行。对应 Kotlin RadioButtonPreference。

MiuixRadioButton 的位置由 radioButtonLocation 决定。当 selected 为 true 时单选按钮处于选中态,且标题/摘要颜色切换为 primary。 点击整行会触发 onClick 并给出触感反馈(已选中→ToggleOff,未选中→ToggleOn)。

Inheritance

Constructors

MiuixRadioButtonPreference({Key? key, required String title, required bool selected, VoidCallback? onClick, String? summary, MiuixRadioButtonPreferenceColors? colors, MiuixRadioButtonColors? radioButtonColors, Widget? startAction, List<Widget>? endActions, MiuixRadioButtonLocation radioButtonLocation = MiuixRadioButtonLocation.start, Widget? bottomAction, EdgeInsetsGeometry insideMargin = MiuixBasicComponentDefaults.insideMargin, bool holdDownState = false, bool enabled = true})
const

Properties

bottomAction → Widget?
底部内容(可选),位于主行下方。
final
colors → MiuixRadioButtonPreferenceColors?
标题/摘要颜色;为 null 时取 MiuixRadioButtonPreferenceDefaults.radioButtonPreferenceColors。
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
onClick → VoidCallback?
点击回调;为 null 时行不可点击。
final
radioButtonColors → MiuixRadioButtonColors?
单选按钮颜色;为 null 时取 MiuixRadioButtonDefaults.radioButtonColors。
final
radioButtonLocation → MiuixRadioButtonLocation
单选按钮位置,默认 MiuixRadioButtonLocation.start。
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selected → bool
是否处于选中态。
final
startAction → Widget?
起始侧额外内容(可选);位于单选按钮之后,带 5dp 末端间距。
final
summary → String?
行摘要(可选)。
final
title → String
行标题。
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