subscribed_stream

Creator: coderz1093

Last updated:

0 purchases

TODO
Add to Cart

Description:

subscribed stream

A utiliy class for easy stream subscription handling
Features #

Create a StreamSubscription Object from a Stream
Transform the event data with the build in callback method
Cache the latest received event data

Getting started #

Recommended use inside BLOC or Provider classes

Usage #
final stream = getRealTimeDataFromDatabase();

final subscribedStream = SubscribedStream<String>(
stream: stream,
onStreamEvent: (data, previousData, subscribedStream) {
if (data != previousData) {
notifyListeners();
}
return data;
},
);

// from UI
final latestValue = subscribedStream.latestValue;
copied to clipboard
Additional information #
Don't hesitate to contact me if you have questions or ideas.

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.