BrnRadioCore class

描述: radio组件

  1. 支持单选/多选
  2. 支持传入待选择widget,可以显示在选择按钮的左边或者右边
  3. 传入widget时,widget和选择按钮使用Row包裹,支持传入Row的属性MainAxisAlignmentMainAxisSize
Inheritance
Available Extensions

Constructors

BrnRadioCore({Key? key, required int radioIndex, 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, Image? selectedImage, Image? unselectedImage, Image? disSelectedImage, Image? disUnselectedImage, VoidCallback? onRadioItemClick, 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
disSelectedImage Image?
final
disUnselectedImage Image?
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
onRadioItemClick VoidCallback?
final
radioIndex int
标识当前Radio的Index
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedImage Image?
final
unselectedImage Image?
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _BrnRadioCoreState
Creates the mutable state for this widget at a given location in the tree.
override
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}) 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