eachItemsInListAsLiveData<T> function

void Function(LiveData<List<T>> liveData) eachItemsInListAsLiveData<T>({
  1. void then(
    1. LiveData<T> item
    )?,
})

Implementation

void Function(LiveData<List<T>> liveData) eachItemsInListAsLiveData<T>({
  void Function(LiveData<T> item)? then,
}) {
  return (LiveData<List<T>> liveData) {
    int i = 0;
    for (var element in liveData.value) {
      LiveData<T> lv = attach(
        liveData,
        element,
        name: '${liveData.name ?? ''}[$i]',
      );
      then?.call(lv);
      i++;
    }
  };
}