showChips<T> method

Future<Set<T>?> showChips<T>({
  1. required List<LabelValue<T>> items,
  2. Set<T>? selected,
  3. String? title,
  4. bool allowEmpty = true,
  5. bool multiSelect = false,
  6. List<Widget>? aboveWidgets,
  7. List<Widget>? belowWidgets,
})

Implementation

Future<Set<T>?> showChips<T>({
  required List<LabelValue<T>> items,
  Set<T>? selected,
  String? title,
  bool allowEmpty = true,
  bool multiSelect = false,
  List<Widget>? aboveWidgets,
  List<Widget>? belowWidgets,
}) async {
  ChipChoiceGroup<T> group = ChipChoiceGroup(items: items, selected: selected, allowEmpty: allowEmpty, multiSelect: multiSelect, alignment: WrapAlignment.center);

  return showColumn(
    onContent: (uc) {
      uc.onValidate = () {
        uc.setResult(group.selected);
        return true;
      };
      return group;
    },
    title: title,
    ok: true,
    cancel: true,
    aboveWidgets: aboveWidgets,
    belowWidgets: belowWidgets,
  );
}