OudsRadioButton<T> class

OUDS Radio Button Design Guidelines

An OUDS radio button widget.

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.

You can use OudsRadioButton like this :

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,
);
Inheritance

Constructors

OudsRadioButton.new({Key? key, required T value, required T groupValue, required ValueChanged<T?>? onChanged, bool isError = false})
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
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
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