class MyPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Defaul
Just to sum up:
The main difference is broadcast()
creates a Stream
listenable for multiple sources but it needs to be listened for at least one source to start emitting items.
A Stream should be inert until a subscriber starts listening on it (using the [onListen] callback to start producing events).
asBroadcastStream
turns an existing Stream
into a multi listenable one but it doesn't need to be listened to start emitting since it calls onListen()
under the hood.