Streams & Reactive Data
Learn how to work with Dart Streams in Flutter to handle continuous asynchronous data such as live updates, sockets and reactive UI.
Beyond a Single Future
A Future gives you one value later. A Stream gives you many values over time.
- WebSocket messages
- Sensor readings
- Live database updates
Streams are the reactive backbone of async Dart.
Listening to a Stream
Subscribe to a stream with listen, supplying callbacks for data, errors and completion.
stream.listen(
(data) => print('Got: ' + data.toString()),
onError: (e) => print('Error: ' + e.toString()),
onDone: () => print('Done'),
);All lessons in this course
- Futures & Async/Await
- HTTP Requests & JSON
- Error Handling in Async
- Streams & Reactive Data