replaceAsyncRadioItems<T> method
Replaces all cached radio button items in an async radio group field with a new list.
fieldName: The name of the async radio group field to update.items: The new list of radio button items to set.
Implementation
void replaceAsyncRadioItems<T>(
String fieldName,
List<RadioButtonFieldState<T>> items,
) {
final field = state.asyncRadioGroup<T>(fieldName);
state.fields[fieldName] = field.copyWith(
cachedItems: List<RadioButtonFieldState<T>>.from(items),
items: Future.value(items),
);
state = state.copyWith(fields: Map.from(state.fields));
}