StacRadio class

A Stac model representing Flutter's Radio and CupertinoRadio widgets.

Displays a circular selection control that allows the user to select one option from a set. The radioType controls whether a Material, Cupertino, or adaptive variant is rendered by the parser.

{@tool snippet} Dart Example:

StacRadio(
  radioType: StacRadioType.material,
  value: 'a',
  groupId: 'letter',
  activeColor: StacColors.blue,
)

{@end-tool}

{@tool snippet} JSON Example:

{
  "type": "radio",
  "radioType": "material",
  "value": "a",
  "groupId": "letter",
  "activeColor": "#2196F3"
}

{@end-tool}

See also:

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

Constructors

StacRadio.new({StacRadioType? radioType, dynamic value, String? groupId, StacAction? onChanged, StacMouseCursor? mouseCursor, bool? toggleable, StacColor? activeColor, StacColor? inactiveColor, StacColor? fillColor, StacColor? focusColor, StacColor? hoverColor, StacColor? overlayColor, double? splashRadius, StacMaterialTapTargetSize? materialTapTargetSize, StacVisualDensity? visualDensity, bool? autofocus, bool? useCheckmarkStyle, bool? useCupertinoCheckmarkStyle})
Creates a StacRadio.
const
StacRadio.fromJson(Map<String, dynamic> json)
Creates a StacRadio from a JSON map.
factory

Properties

activeColor StacColor?
The color used when this radio is selected.
final
autofocus bool?
Whether this radio should focus itself if nothing else is focused.
final
fillColor StacColor?
The color of the radial reaction (Material) or fill (Cupertino).
final
focusColor StacColor?
The color to use for the focus highlight.
final
groupId String?
Identifier to associate this radio with a group in scope. Used by the parser to look up the current groupValue.
final
hashCode int
The hash code for this object.
no setterinherited
hoverColor StacColor?
The color to use for the hover highlight.
final
inactiveColor StacColor?
The color used when this radio is not selected (Cupertino only).
final
jsonData Map<String, dynamic>?
Raw JSON data for this widget
finalinherited
materialTapTargetSize StacMaterialTapTargetSize?
Configures the minimum size of the area within which the radio may be pressed.
final
mouseCursor StacMouseCursor?
Mouse cursor to display when hovering this widget.
final
onChanged StacAction?
Action invoked when the user selects this radio.
final
overlayColor StacColor?
The color to use for the overlay.
final
radioType StacRadioType?
Which platform style of radio to render.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
splashRadius double?
The splash radius of the radio's splash in logical pixels.
final
toggleable bool?
Whether this radio can be unselected.
final
type String
Widget type identifier.
no setteroverride
useCheckmarkStyle bool?
Whether to use a checkmark style for Cupertino radios.
final
useCupertinoCheckmarkStyle bool?
Whether to use a Cupertino checkmark style when using adaptive radios.
final
value → dynamic
The value represented by this radio.
final
visualDensity StacVisualDensity?
Defines how compact the radio's layout is.
final

Methods

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

Operators

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