loadChoiceItems method
void
loadChoiceItems()
load the choice items
Implementation
void loadChoiceItems () async {
try {
setState(() {
error = null;
loading = true;
});
if (widget.choiceLoader != null) {
final List<C2Choice<T>> items = await widget.choiceLoader!();
setState(() => choiceItems = items);
} else {
setState(() => choiceItems = widget.choiceItems);
}
} catch (e) {
setState(() => error = e as Error?);
} finally {
setState(() => loading = false);
}
}