built_bloc 0.1.4-dev copy "built_bloc: ^0.1.4-dev" to clipboard
built_bloc: ^0.1.4-dev copied to clipboard

outdated

Generates the BLoC boilerplate.

built_bloc #

Helper class for adopting the BLoC pattern, alongside with a few annotations to use in combination with built_bloc_generator (which is stongly recommended).

Quickstart #

Simply extends from Bloc and access various helpers for registering subjects (like addPublish, addBehavior) and the dispose method which will close all underlying subscriptions.

class ExampleBloc extends Bloc {
  Sink<int> get add => this._add.sink;

  Stream<int> get count => this._add.stream;

  PublishSubject<int> _add;

  BehaviorSubject<int> _count;

  ExampleBloc() {
    this._add = addPublish(onData: _onAdd);
    this._count = addBehavior(0);
  }

  void _onAdd(int value) {
    this._count.add(this._count.value + 1);
  }
}

How to use #

Install #

dependencies:
  built_bloc:
0
likes
0
pub points
9%
popularity

Publisher

unverified uploader

Generates the BLoC boilerplate.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

meta, rxdart

More

Packages that depend on built_bloc