flutter_bloc_stream 4.3.2

Flutter Android iOS web

Helper package for using bloc_stream with Flutter. Includes BlocStreamProvider and BlocStreamBuilder.

flutter_bloc_stream #

This package provides two helpers to help reduce boilerplate when working with bloc_stream:

BlocStreamProvider #

This is a simple wrapper around the Provider package that automatically disposes BlocStreams for you.

// Create a provider
BlocStreamProvider(
    create: (context) => CounterBloc(),
    child: myApp,
);

// Consume in a child context.
final counter = BlocStreamProvider.of<CounterBloc>(context);

BlocStreamBuilder #

A simple wrapper around StreamBuilder for building a widget tree when the data changes. If the bloc parameter then it will automatically look for the BLoC using BlocStreamProvider.of:

BlocStreamBuilder<CounterBloc, int>(builder: (context, snapshot) {
    if (snapshot.hasError) return Text("Fail.");
    else if (!snapshot.hasData) return Container();

    return Text("${snapshot.data}");
});
0
likes
100
pub points
42%
popularity

Helper package for using bloc_stream with Flutter. Includes BlocStreamProvider and BlocStreamBuilder.

Repository (GitLab)
View/report issues

Documentation

API reference

Uploader

tim@fostle.com

License

MIT (LICENSE)

Dependencies

bloc_stream, flutter, flutter_hooks, provider

More

Packages that depend on flutter_bloc_stream