value property

T? get value

Returns the value of the selected item in this controller's radio group.

@throws ControllerDecoupledException If the controller cannot access the value of its radio group.

Implementation

T? get value {
  if (_myRadioGroup != null) {
    return _myRadioGroup!.value;
  }

  // If it makes it to this point, something has gone wrong.
  throw ControllerDecoupledException(radioGroupController: this);
}
set value (T? value)

Sets the value of the selected item in this controller's radio group.

@throws IllegalValueException If the value provided is not a value in the radio group's values list.

@throws ControllerDecoupledException If the controller cannot access the value of its radio group.

Implementation

set value(T? value) {
  if (_myRadioGroup != null) {
    if (value != null && !_myRadioGroup!.widget.values.contains(value)) {
      throw IllegalValueException(value: value);
    }

    _myRadioGroup!.value = value;
    return;
  }

  // If it makes it to this point, something has gone wrong.
  throw ControllerDecoupledException(radioGroupController: this);
}