loadChoiceItems method

void loadChoiceItems()

load the choice items

Implementation

void loadChoiceItems() async {
  try {
    setState(() {
      error = null;
      loading = true;
    });
    if (widget.choiceLoader != null) {
      final List<ChipSelectionData<T>> items = await widget.choiceLoader!();
      setState(() => choiceItems = items);
    } else {
      setState(() => choiceItems = widget.choiceItems);
    }
  } on Error catch (e) {
    setState(() => error = e);
  } finally {
    setState(() => loading = false);
  }
}