extended_bloc 0.0.2-dev

Dart native js
Flutter Android iOS web

A predictable state management library that helps implement the BLoC design pattern.

Extended BLoC #

Actions Status Coverage Pub License: WTFPL effective_dart

EnumBloc<Event, State> #

BLoC with primitive events.

Override [router] and create generators.

Example usage:

class MyEnumBloc extends EnumBloc<Event, State> {

  MyEnumBloc() : super(State.initial);

  @override
  Map<Event, Function> get router =>
    <Event, Function>{
      Event.read : _read,
    };

  Stream<MockState> _read() async* {
    yield State.performing;
    // ...
    yield State.fetched;
  }
}

RouterBloc<Event, State> #

BLoC with complex events, containing internal data.

Override [router] and create generators.

Example usage:

class MyRouterBloc extends RouterBloc<Event, State> {

  MyRouterBloc() : super(InitialState());

  @override
  Map<Type, Function> get router =>
    <Type, Function>{
      PerformEvent : _perform,
    };

  Stream<State> _perform(PerformEvent event) async* {
    yield PerformingState();
    // ...
    yield PerformedState();
  }
}

Coverage #

Changelog #

Refer to the Changelog to get all release notes.

Features and bugs #

Please file feature requests and bugs at the issue tracker.

Maintainers #

Plague Fox

License #

WTFPL

3
likes
110
pub points
24%
popularity

Publisher

plugfox.dev

A predictable state management library that helps implement the BLoC design pattern.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

unknown (LICENSE)

Dependencies

bloc

More

Packages that depend on extended_bloc