buildChoicesList method

  1. @override
List<Widget> buildChoicesList(
  1. BuildContext context,
  2. List<DialogChoice<T>> selectedChoices,
  3. Function setState
)
override

Implementation

@override
// ignore: avoid_renaming_method_parameters
List<Widget> buildChoicesList(BuildContext context,
    List<DialogChoice<T>> selectedChoices, Function setState) {
  return choices
      .map<InkWell>((e) => InkWell(
          onTap: () => onTap(e, selectedChoices, setState),
          child: Padding(
              padding: const EdgeInsets.only(left: 10, right: 24),
              child: Row(
                  mainAxisAlignment: MainAxisAlignment.start,
                  children: [
                    Radio<DialogChoice<T>>(
                      value: e,
                      groupValue: (selectedChoices.isEmpty
                          ? null
                          : selectedChoices.first),
                      onChanged: (dialogChoice) =>
                          onTap(e, selectedChoices, setState),
                    ),
                    e.icon,
                    buildChoicesDetail(context, e)
                  ].where((element) => element != null).toList().cast()))))
      .toList();
}