RadioSuperFormField<T> class
Base class for creating radio groups that extends SuperFormField.
This widget's state automatically registers field for name so there is no need for manual registration.
Specify rules to add validation for this field. Errors will not be displayed automatically. Consider putting SuperFormErrorText below the field.
The field will automatically clear group value it no longer have corresponding option.
RadioSuperFormField.listTile(
name: "size",
options: const [
RadioOption("s", Text("Small")),
RadioOption("m", Text("Medium")),
RadioOption("l", Text("Large")),
RadioOption("xl", Text("X-Large")),
],
rules: [RequiredRule("Please choose size")],
dense: true,
),
See also:
- CheckboxSuperFormField, which is checkbox version of this widget
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SuperFormField
- RadioSuperFormField
Constructors
-
RadioSuperFormField({Key? key, required RadioBuilder<
T> builder, required String name, required List<RadioOption< options, List<T> >SuperFormFieldRule> ? rules, void onChanged(T? value)?, bool? enabled}) -
Creates a RadioSuperFormField that delegates its build to a
builder
while providing helpful RadioState abstraction. -
RadioSuperFormField.listTile({Key? key, required String name, required List<
RadioOption< options, List<T> >SuperFormFieldRule> ? rules, bool toggleable = false, Color? activeColor, Widget subtitle(RadioOption<T> option)?, bool isThreeLine = false, bool? dense, Widget? secondary, bool selected(RadioOption<T> option)?, ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform, bool autofocus = false, EdgeInsetsGeometry? contentPadding, ShapeBorder? shape, Color? tileColor, Color? selectedTileColor, void onChanged(T? value)?, bool? enabled}) - Creates a Column of connected RadioListTiles which represent the options.
Properties
- builder → SuperFormFieldBuilder
-
finalinherited
- enabled → bool?
-
If false, the field will be displayed as disabled.
final
- focusNode → FocusNode?
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- name → String
-
Name of the field
finalinherited
- noFormFallback → Widget
-
Fallback widget for a case where SuperForm ancestor is unavailable
finalinherited
-
options
→ List<
RadioOption< T> > -
List of available options
final
-
rules
→ List<
SuperFormFieldRule> -
Field validation rules
finalinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → _RadioSuperFormFieldState< T> -
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