RadioButton class
单选按钮
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- RadioButton
Constructors
- RadioButton({Key? key, required int radioIndex, required void onValueChangedAtIndex(int, bool), bool disable = false, bool isSelected = false, EdgeInsets? iconPadding, Widget? child, bool childOnRight = true, MainAxisAlignment mainAxisAlignment = MainAxisAlignment.start, CrossAxisAlignment crossAxisAlignment = CrossAxisAlignment.center, MainAxisSize mainAxisSize = MainAxisSize.min, HitTestBehavior behavior = HitTestBehavior.translucent})
-
const
Properties
- behavior → HitTestBehavior
-
默认值HitTestBehavior.translucent控制widget.onRadioItemClick触发的点击范围
final
- child → Widget?
-
配合使用的控件,比如卡片或者text
final
- childOnRight → bool
-
控件是否在选择按钮的右边,
true时 控件在选择按钮右边
false时 控件在选择按钮的左边
默认true
final
- crossAxisAlignment → CrossAxisAlignment
-
控件和选择按钮在row布局里面的crossAxisAlignment
默认值CrossAxisAlignment.center
final
- disable → bool
-
是否禁用当前选项
默认false
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- iconPadding → EdgeInsets?
-
选择按钮的padding
默认EdgeInsets.all(5)
final
- isSelected → bool
-
初始值,是否被选择
默认false
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- mainAxisAlignment → MainAxisAlignment
-
控件和选择按钮在row布局里面的alignment
默认值MainAxisAlignment.start
final
- mainAxisSize → MainAxisSize
-
控件和选择按钮在row布局里面的mainAxisSize
默认值MainAxisSize.min
final
- onValueChangedAtIndex → void Function(int, bool)
-
value 选项发生变化产生的回调
int 选项的index
bool 选项的选中状态,true表示选中,false未选中
final
- radioIndex → int
-
标识当前Radio的Index
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
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