bloc_event 1.0.6 copy "bloc_event: ^1.0.6" to clipboard
bloc_event: ^1.0.6 copied to clipboard

discontinued

With this package you can define the logic that an bloc event executes inside the events class.

example/main.dart

import 'package:bloc_event/bloc_event.dart';

abstract class CounterEvent<E> extends Event<CounterBloc, int> {}

class CounterBloc extends EventBloc<CounterEvent, int> {

  @override
  int get initialState => 0;

}

class CounterIncrement extends CounterEvent {
  final int value;

  CounterIncrement(this.value);

  @override
  Stream<int> onTriggered(bloc, state) async* {
    yield state+value;
  }
}

void main() {
  final counterBloc = CounterBloc();
  counterBloc.add(CounterIncrement(2));
}
3
likes
40
pub points
0%
popularity

Publisher

verified publisherownii.com

With this package you can define the logic that an bloc event executes inside the events class.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

bloc

More

Packages that depend on bloc_event