FRadio<T> class

FRadio 灵活精美的单选组件,使用 FRadio 可以快速构建出丰富而精彩的单选视图。 FRadio 允许开发者为整个单选组件的交互周期状态进行精准的配置,这对于现代应用程序是十分重要的。 现在,我们用户总是期待自己的每一次交互都能获得反馈。而 FRadio 使得这种复杂的状态变化带来的视图变化的构建,变得异常简单。

FRadio Flexible and beautiful radio components, using FRadio can quickly build a rich and wonderful radio view. FRadio allows developers to accurately configure the interaction cycle state of the entire radio component, which is very important for modern applications. Now, our users always expect feedback from each interaction. And FRadio makes the construction of the view changes brought by such complex state changes extremely simple.

Inheritance

Constructors

FRadio({Key? key, required T? value, required T? groupValue, ValueChanged<T?>? onChanged, double width = 27, double height = 27, bool enable = true, bool toggleable = false, FocusNode? focusNode, bool autofocus = false, Color selectedColor = const Color(0xff2593fc), Color normalColor = const Color(0xffd9d9d9), bool hasSpace = true, double? border, Widget? child, Widget? selectedChild, Widget? hoverChild, Gradient? gradient, Duration duration = const Duration(milliseconds: 150), bool fill = true, FRadioCorner? corner})
默认情况下,FRadio 有一套十分灵活的样式风格。 开发者无需自己配置 normalselecteddisableNormaldisableSelected 以及 hoverFRadio 提供了丰富的配置选项,以帮助开发者快速完成视图的构建。 如果在应用中有独特的设计,可以使用 FRadio.custom 来完成特殊样式的构建。FRadio 将帮助开发者完成状态管理的构建。
FRadio.custom({Key? key, T? value, T? groupValue, ValueChanged<T?>? onChanged, Widget? normal, Widget? selected, Widget? disableNormal, Widget? disableSelected, Widget? hover, double width = 27, double height = 27, bool enable = true, bool toggleable = false, FocusNode? focusNode, bool autofocus = false})
FRadio.custom 构造函数允许用户自定义配置 normalselecteddisableNormaldisableSelected 以及 hover

Properties

autofocus bool
是否允许自动获取焦点
final
disableNormal Widget?
未选中状态时的不可用样式
getter/setter pair
disableSelected Widget?
选中状态样式不可用样式
getter/setter pair
enable bool
是否可用。不可用的 FRadio 将无法通过点击改变当前状态。 通过 disableNormaldisableSelected 可以自定义不可用状态下的样式。
final
focusNode FocusNode?
焦点
final
groupValue → T?
单选组当前选中的值。当 groupValue == value 时,进入选中状态。
final
hashCode int
The hash code for this object.
no setterinherited
height double
高度。
final
hover Widget?
鼠标进入时的样式
getter/setter pair
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
normal Widget?
未选中状态样式
getter/setter pair
onChanged ValueChanged<T?>?
FRadio 被变为选中时会回调
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selected Widget?
选中状态样式
getter/setter pair
toggleable bool
是否可以取消选中。
final
value → T?
FRadio 所代表的的值。当 groupValue == value 时,进入选中状态。
final
width double
宽度。
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<StatefulWidget>
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