stream_live_data 0.0.19 stream_live_data: ^0.0.19 copied to clipboard
Flutter stream made easy
STREAM TO LIVE DATA #
Flutter Streams wrapped for easy use.
Getting Started #
Add Dependency Add below dependency in pubspec.yaml.
dependencies:
stream_live_data: ^0.0.2
- Initialize LiveStream Instance You can create instance as below.
LiveData<String> liveData = LiveData<String>();
*Subscribe to changes Register to LiveData changes
LiveDataToken token = liveData.register((event) {
print("Rvent Received: $event");
});
*Update Live Data Value
liveData.add(newValue);
*Clean up Don't forget to unregister when done
liveData.unRegister(token);
or
token.cancel();
Enjoy.