transformData<E> method Null safety

RemoteModel<E> transformData<E>(
  1. E transform(
    1. T value
    )
)

Implementation

RemoteModel<E> transformData<E>(E Function(T value) transform) {
  return when(
    initial: () => RemoteModel.initial(),
    loading: () => RemoteModel.loading(),
    data: (v) => RemoteModel.data(transform(v)),
    error: (error) => RemoteModel.error(error),
  );
}