I have a BLoC that consumes a raw input Stream
(that yields a list of JSON objects) and transforms it to usable objects using a StreamTransformer
. The UI shows that list. The user can apply a filter (itself a stream into the BLoC), such that the BLoC updates the input stream transformer with respective where(...)
statements.
The question is: When the filter changes, the UI is not updated because the output stream depends on events of the JSON input stream, not the filter stream. My assumption is I need to either create my own stream into which I forward both input events and filter events, or I need to repeat on the transformed input stream the last event, such that the transformer has a chance to pick it up. How is this done properly? An example would help a lot!