StacRadioGroup class

A Stac model representing a radio group scope similar to Flutter's form scope.

Establishes a StacRadioGroupScope at runtime so descendant radio widgets can read and update a shared selected value via the scope. This widget does not render UI itself; it provides the scope and renders its child.

{@tool snippet} Dart Example:

StacRadioGroup(
  id: 'favoriteFruit',
  groupValue: 'apple',
  child: StacColumn(children: [
    StacRadio(value: 'apple'),
    StacRadio(value: 'banana'),
  ]),
)

{@end-tool}

{@tool snippet} JSON Example:

{
  "type": "radioGroup",
  "id": "favoriteFruit",
  "groupValue": "apple",
  "child": {
    "type": "column",
    "children": [
      { "type": "radio", "value": "apple" },
      { "type": "radio", "value": "banana" }
    ]
  }
}

{@end-tool}

See also:

  • Flutter's Radio documentation (https://api.flutter.dev/flutter/material/Radio-class.html)
Inheritance
Annotations
  • @JsonSerializable()

Constructors

StacRadioGroup.new({String? id, dynamic groupValue, StacWidget? child})
Creates a StacRadioGroup.
const
StacRadioGroup.fromJson(Map<String, dynamic> json)
Creates a StacRadioGroup from a JSON map.
factory

Properties

child StacWidget?
The widget subtree to render within the radio group scope.
final
groupValue → dynamic
The initially selected value shared among descendant StacRadio widgets.
final
hashCode int
The hash code for this object.
no setterinherited
id String?
The identifier under which the selected value will be saved in a StacFormScope's form data.
final
jsonData Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
type String
Widget type identifier.
no setteroverride

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() Map<String, dynamic>
Converts this StacRadioGroup instance to a JSON map.
override
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited