Dart Computer Programming for Intermediates: 08 Await for versus Listen

Published: 24 March 2019
on channel: Dash to Dartlang
787
21

await for and listen are both methods used to access Streams in Dart.

await for - when you need to hold everything up, and need to Stream to finish. When there is a small, finite set of data.
listen - BroadcastStreams. Not blocking. Potentially large amount of data.
async - when you wait for at most 1 piece of data.
async* - when expecting more than 1 piece of data.