The StreamBuilder works just like a FutureBuilder, but it updates its content in real time to match the content of a given stream, instead of simply displaying the result of a given future like the FutureBuilder does:
| StreamBuilder( |
| stream: myStream(), |
| builder: (context, snapshot) { |
| if(!snapshot.hasData) return CircularProgressIndicator(); |
| return MyWidget( |
| data: snapshot.data |
| ); |
| } |
| ) |