ObservableStream<List<Type>> convert to List and/or ObservableList<Type> Flutter Mobx

79 Views Asked by At

I have setup a sqlite stream from Drift: Stream<List> into my @oberservable class. I can make it an OberserableStream, but I dont understand how to get the list from the stream.

My question is how can I get the list from the ObservableStream and make it an ObservableList or make it an ObeservableList directly from Stream?

Here's what I got wrong so far. I have tried many permutations of this but IDE keeps telling me that its wrong type, wrong .map, wrong <whatever>

@observable  
ObservableList<TodoDrift> streamTodos() {
    ObservableStream<List<TodoDrift>> list = stObv.asObservable();
    List<TodoDrift> prod = list.map(
            (e) {
               return e.done != true;
              });
    return prod.asObservable();
    // return Future.wait(olStream);
  }

Thank you!

FWIW. I also have a Future<List> from Drift and that works fine, I can get the list from there, so that works and I know the data is there.

0

There are 0 best solutions below