loadingFuture property Null safety

Future<RemoteModel<T>> loadingFuture

return state if it loaded or await first data | error event and return

Implementation

Future<RemoteModel<T>> get loadingFuture async {
  if (state.isLoaded) return state;
  return stream.firstWhere((e) => state.isLoaded);
}