Search⌘ K
AI Features

Types of Streams

Explore the different types of Streams in Dart's asynchronous programming, including single subscription and broadcast streams. Learn how to create and subscribe to Streams using the listen method and subscription handlers to handle events, errors, and completion notifications.

Types of Streams

There are two types of Streams that one can be used to carry out the asynchronous operations.

  1. Single Subscription

    Single subscription streams are meant to deliver events in order. These types of streams are used when the order of events received matters; like reading a file. Such types of Streams can only be listened to once. Attempting to listen to them again will throw an exception. ...