Direction enum

const Radio({ Key key, @required this.value, // 当前单选框设置的值 @required this.groupValue, // 当前单选框选定状态的值 @required this.onChanged, // 选中回调 this.activeColor, // 选中状态颜色 this.focusColor, // 获取焦点时颜色 this.hoverColor, // 高亮时颜色 this.materialTapTargetSize, // 点击范围最小大小 this.focusNode, this.autofocus = false, })

Radio 是一个有状态的 StatefulWidget 小组件;Radio 单选框本身不保持任何状态,通过 onChanged 回调,来判断当前 value 是否与 groupValue 选项组中对应的 item 是否一致,来判断选中状态;一般通过调用 State.setState() 更新单选按钮的 groupValue 从而响应 onChanged 回调;

Radio 单选框一般分为三个状态,分别为未选中状态、选中状态和不可选中状态;onChanged 为单选框选中的回调,根据 value 和 groupValue 匹配是否为选中状态; 当 onChanged 为 null 时,单选框为不可选中状态;

Inheritance

Constructors

Direction()
const

Values

HORIZATION → const Direction
VERTICAL → const Direction

Properties

hashCode int
The hash code for this object.
no setterinherited
index int
A numeric identifier for the enumerated value.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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.
inherited

Constants

values → const List<Direction>
A constant List of the values in this enum, in order of their declaration.