bloc_streambuilder 0.3.2

Flutter Android iOS web

A stream builder that uses the inital value of the bloc_stream.

bloc_streambuilder #

A stream builder that uses the value of a ValueObservable as initial data. This builder in combination with ValueSubject makes sure that the streambuilder does not need to build twice when the stream already has a value.

Example #


     ValueObservable<int> stream = ValueSubject(seedValue: 0);

     ValueObservableBuilder(
       builder: (context, snapshot) { // Only called once and immediately with data if the stream has data

         print(
             "Build called with data: ${snapshot.data}, connectionState: ${snapshot.connectionState}"
         ); // First time it prints "Build called with data: 0, connectionState: ConnectionState.active"

         return new Text('${snapshot.data}');
       },
       stream: stream,
     )
0
likes
100
pub points
28%
popularity

A stream builder that uses the inital value of the bloc_stream.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

pieter.v.loon94@gmail.com

License

MIT (LICENSE.md)

Dependencies

flutter, rxdart

More

Packages that depend on bloc_streambuilder