XRadio<T> class
单选组件
- Inheritance
- Available Extensions
Constructors
-
XRadio({Key? key, required T value, required T groupValue, required 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, XRadioCorner? corner}) - 默认情况下,XRadio 有一套十分灵活的样式风格。 开发者无需自己配置 normal、selected、disableNormal、disableSelected 以及 hover。 XRadio 提供了丰富的配置选项,以帮助开发者快速完成视图的构建。 如果在应用中有独特的设计,可以使用 XRadio.custom 来完成特殊样式的构建。XRadio 将帮助开发者完成状态管理的构建。 一般参数 (General parameters):
-
XRadio.custom({Key? key, required T value, required T groupValue, required ValueChanged<
T> onChanged, required Widget? normal, required 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}) - XRadio.custom 构造函数允许用户自定义配置 normal、selected、disableNormal、disableSelected 以及 hover。
Properties
- autofocus → bool
-
final
- disableNormal ↔ Widget?
-
getter/setter pair
- disableSelected ↔ Widget?
-
getter/setter pair
- enable → bool
-
final
- focusNode → FocusNode?
-
final
- groupValue → T
-
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> -
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selected ↔ Widget?
-
getter/setter pair
- toggleable → bool
-
final
- value → T
-
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