listTileRadioBuilder<T> function
Widget
listTileRadioBuilder<T>(
- BuildContext context,
- RadioState<
T> state, { - bool toggleable = false,
- Color? activeColor,
- Widget subtitle(
- RadioOption<
T> option
- RadioOption<
- bool isThreeLine = false,
- bool? dense,
- Widget? secondary,
- bool selected(
- RadioOption<
T> option
- RadioOption<
- ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform,
- bool autofocus = false,
- EdgeInsetsGeometry? contentPadding,
- ShapeBorder? shape,
- Color? tileColor,
- Color? selectedTileColor,
Builder for RadioSuperFormField which builds a Column with RadioListTile for each RadioOption.
Implementation
Widget listTileRadioBuilder<T>(
BuildContext context,
RadioState<T> state, {
bool toggleable = false,
Color? activeColor,
Widget Function(RadioOption<T> option)? subtitle,
bool isThreeLine = false,
bool? dense,
Widget? secondary,
bool Function(RadioOption<T> option)? selected,
ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform,
bool autofocus = false,
EdgeInsetsGeometry? contentPadding,
ShapeBorder? shape,
Color? tileColor,
Color? selectedTileColor,
}) {
return Focus(
focusNode: state.focusNode,
skipTraversal: true,
child: Column(
children: state.options.map((option) {
return RadioListTile(
groupValue: state.groupValue,
onChanged: state.onChanged,
value: option.value,
title: option.label,
toggleable: toggleable,
activeColor: activeColor,
subtitle: subtitle != null ? subtitle(option) : null,
// ignore: avoid_bool_literals_in_conditional_expressions
selected: selected != null ? selected(option) : false,
isThreeLine: isThreeLine,
dense: dense,
secondary: secondary,
controlAffinity: controlAffinity,
autofocus: autofocus,
contentPadding: contentPadding,
shape: shape,
tileColor: tileColor,
selectedTileColor: selectedTileColor,
);
}).toList(),
),
);
}