Using a stream and asynchronous programming in Flutter

Until now in this book, you've seen two kinds of widgets: Stateless and Stateful. The State is what allows you to use data that can change over the lifetime of the widget. And, while this works perfectly in several cases, there are other ways to change data in your app, and one of those is using Streams.

Streams provide an asynchronous sequence of data.

The key concept here is that streams are asynchronous. This is a very powerful concept in programming. Asynchronous programming allows a piece of code to run separately from the main line of execution. That means that the execution of several tasks can run at the same time, instead of running sequentially.

Dart is a single-threaded ...

Get Flutter Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.