buildChoicesList method Null safety

  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<SimpleDialogOption>((e) => SimpleDialogOption(
          onPressed: () {
            confirmDialog(context, [e]);
          },
          child: Row(
              crossAxisAlignment: CrossAxisAlignment.start,
              children: [e.icon, buildChoicesDetail(context, e)]
                  .where((element) => element != null)
                  .toList()
                  .cast())))
      .toList();
}