cast<E> method Null safety

RemoteModel<E> cast<E>()

Implementation

RemoteModel<E> cast<E>() {
  return when(
    initial: () => RemoteModel.initial(),
    loading: () => RemoteModel.loading(),
    data: (v) => RemoteModel.data(v as E),
    error: (error) => RemoteModel.error(error),
  );
}