OudsRadioButton<T> class

OUDS Radio Button Design Guidelines

Reference design version : 1.4.0

Radio button is a UI element that allows to select a single option from a set of mutually exclusive choices. Radio button that does not show icon or text, provides greater flexibility when creating other components that require a Radio button to be displayed.

This widget displays a radio button that is part of a group. It determines its selected state by comparing its own value with the current groupValue. It also supports an error state and notifies changes through onChanged.

Parameters:

  • value: The value represented by this radio button. Used to determine selection.
  • groupValue: The currently selected value in the radio button group. This radio button is considered selected if value == groupValue.
  • onChanged: Callback triggered when the user selects this radio button. If null, the radio button is disabled and non-interactive.
  • isError: Indicates whether the radio button is in an error state.
  • readOnly: Controls the read only state of the radio button. When true the radio button is disabled.
  • skeleton: An optional skeleton that improves the perceived loading time by providing a visual cue of where the radio button will appear once fully loaded.

You can use OudsRadioButton component in your project, customizing parameters as needed :

Selection status :

Typically, a radio button has two main states: Selected and Unselected.

'selected' : The radio button is actively chosen by the user, indicating the associated option is selected. 'unselected' : The radio button is not chosen, showing the user that the associated option is available but not selected.

 OudsRadioButton<RadioOption>(
   value: true,
   groupValue: true,
   onChanged: (RadioOption? value) {
       // Handle radio button change state.
   }
   isError: false,
   readOnly: false,
   skeleton: OudsSkeleton(),
);
Inheritance

Constructors

OudsRadioButton({Key? key, required T value, required T groupValue, required ValueChanged<T?>? onChanged, bool isError = false, bool readOnly = false, OudsSkeleton? skeleton})
const

Properties

groupValue → T
final
hashCode → int
The hash code for this object.
no setterinherited
isError → bool
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onChanged → ValueChanged<T?>?
final
readOnly → bool
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
skeleton → OudsSkeleton?
final
value → T
final

Methods

createElement() → StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → OudsRadioButtonState<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