listTileRadioBuilder<T> function

Widget listTileRadioBuilder<T>(
  1. BuildContext context,
  2. RadioState<T> state, {
  3. bool toggleable = false,
  4. Color? activeColor,
  5. Widget subtitle(
    1. RadioOption<T> option
    )?,
  6. bool isThreeLine = false,
  7. bool? dense,
  8. Widget? secondary,
  9. bool selected(
    1. RadioOption<T> option
    )?,
  10. ListTileControlAffinity controlAffinity = ListTileControlAffinity.platform,
  11. bool autofocus = false,
  12. EdgeInsetsGeometry? contentPadding,
  13. ShapeBorder? shape,
  14. Color? tileColor,
  15. 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(),
    ),
  );
}