easyRadioOf<T> function

Widget easyRadioOf<T>({
  1. required List<T> items,
  2. T? value,
  3. ValueChanged<T?>? onChanged,
  4. String itemLabel(
    1. T
    )?,
  5. String? label,
})

Creates a radio button group.

items - The list of items to display. value - The currently selected value. onChanged - Callback when an item is selected. itemLabel - Function to convert an item to a string label. label - Optional label for the radio group.

Implementation

Widget easyRadioOf<T>({
  required List<T> items,
  T? value,
  ValueChanged<T?>? onChanged,
  String Function(T)? itemLabel,
  String? label,
}) {
  return _easyLabelWrapper(
    label: label,
    child: EasyRadioGroup<T>(
      items: items,
      value: value,
      onChanged: onChanged,
      labelBuilder: null,
      itemBuilder: (context, item, selected) =>
          _defaultItemBuilder(context, item, selected, itemLabel),
    ),
  );
}