SignalRadioGroup<T> class
A reactive group of radio buttons for single-value selection, bound to a Field<T>.
Each SignalFieldOption in options renders as a Radio + label pair
wrapped in a Material RadioGroup. Selecting an option writes its value
to field.value and calls Field.touch. The Field.error is surfaced
inside the InputDecorator once the field is touched.
T is the type of the selected value.
field is the backing Field<T>.
options is the ordered list of SignalFieldOption items to display.
decoration wraps the group with a Material InputDecoration; the error
text is driven by Field.error once touched.
orientation — Axis.vertical stacks options top-to-bottom (default);
Axis.horizontal wraps them in a Wrap side-by-side.
activeColor overrides the selected radio button fill color.
focusColor overrides the focus ring color.
hoverColor overrides the hover ring color.
splashRadius overrides the ink splash radius on tap.
visualDensity adjusts the spacing around each radio button.
enabled — when false, all radio buttons are disabled.
focusNode overrides the internally managed FocusNode.
Example:
final gender = Field<String>('gender')
..required(message: 'Selecione uma opção');
SignalRadioGroup<String>(
field: gender,
decoration: const InputDecoration(labelText: 'Gênero'),
options: const [
SignalFieldOption(value: 'M', label: 'Masculino'),
SignalFieldOption(value: 'F', label: 'Feminino'),
SignalFieldOption(value: 'O', label: 'Outro'),
],
)
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- SignalRadioGroup
Constructors
-
SignalRadioGroup({Key? key, required Field<
T> field, required List<SignalFieldOption< options, InputDecoration decoration = const InputDecoration(), Axis orientation = Axis.vertical, Color? activeColor, Color? focusColor, Color? hoverColor, double? splashRadius, VisualDensity? visualDensity, bool enabled = true, FocusNode? focusNode})T> > -
const
Properties
- activeColor → Color?
-
final
- decoration → InputDecoration
-
final
- enabled → bool
-
final
-
field
→ Field<
T> -
final
- focusColor → Color?
-
final
- focusNode → FocusNode?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- hoverColor → Color?
-
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
-
options
→ List<
SignalFieldOption< T> > -
final
- orientation → Axis
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- splashRadius → double?
-
final
- visualDensity → VisualDensity?
-
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< SignalRadioGroup< 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, 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