radioOptionBuilder<T> function
A FastRadioOptionBuilder that is the default FastRadioGroup.optionBuilder.
Returns a RadioListTile when FastRadioGroup.orientation is FastRadioGroupOrientation.vertical.
Returns an Expanded widget that contains a RadioListTile when FastRadioGroup.orientation is FastRadioGroupOrientation.horizontal.
Implementation
Widget radioOptionBuilder<T>(
FastRadioOption<T> option, FastRadioGroupState<T> field) {
final FastRadioGroupState<T>(:didChange, :enabled, :value, :widget) = field;
final tile = RadioListTile<T>(
activeColor: widget.activeColor,
controlAffinity: widget.controlAffinity,
fillColor: widget.fillColor,
hoverColor: widget.hoverColor,
groupValue: value,
isThreeLine: option.isThreeLine,
materialTapTargetSize: widget.materialTapTargetSize,
mouseCursor: widget.mouseCursor,
onChanged: enabled ? didChange : null,
overlayColor: widget.overlayColor,
secondary: option.secondary,
selected: option.selected,
selectedTileColor: widget.selectedTileColor,
shape: widget.shapeBorder,
splashRadius: widget.splashRadius,
subtitle: option.subtitle,
tileColor: widget.tileColor,
title: option.title,
toggleable: widget.toggleable,
value: option.value,
visualDensity: option.visualDensity,
);
return widget.orientation == FastRadioGroupOrientation.vertical
? tile
: Expanded(child: tile);
}