single_bloc_base 1.0.0+1 copy "single_bloc_base: ^1.0.0+1" to clipboard
single_bloc_base: ^1.0.0+1 copied to clipboard

discontinued

Platform agnostic Bloc interfaces + HookBloc for Dart and Flutter

single_bloc_base #

extra_pedantic on pub.dev Travis CI Codecov License Pub.dev Github Stars Twitter Follow GitHub Follow

Platform agnostic Bloc interfaces + HookBloc for Dart and Flutter

Provides interfaces for:

  • Disposable Blocs:
class ExampleBloc implements BlocBase {
  const ExampleBloc();

  @override
  Future<void> dispose() async {
  }
}
  • Initializable Objects:
class ExampleInit implements InitBase {
  const ExampleInit();

  @override
  Future<void> init() async {
  }
}
  • Initializable Blocs:
class ExampleBlocWithInit implements InitBloc {
  const ExampleBlocWithInit();

  @override
  Future<void> dispose() async {
  }

  @override
  Future<void> init() async {
  }
}
  • Bagged Initializable Blocs
class ExampleBaggedBloc extends BaggedInitBloc {
  ExampleBaggedBloc(Iterable<BlocBase> blocs,
      Iterable<InitializableBlocBase> initializableBlocs) {
    blocs.forEach(bagBloc);
    initializableBlocs.forEach(bagState);
    disposeLater(() => print("dispose me later"));
    initLater(() => print("init me later"));
  }
}
  • Hook Blocs that give you the ability to schedule objects for disposal in one line during their initialization:
class ExampleHookBloc extends HookBloc {
  final MyOtherBloc otherBloc = HookBloc.disposeBloc(MyOtherBloc());
}

class MyOtherBloc extends BlocBase {
  MyOtherBloc() {}

  @override
  Future<void> dispose() async {
    print("MyOtherBloc dispose");
  }
}
0
likes
40
pub points
0%
popularity

Publisher

verified publishermodulovalue.com

Platform agnostic Bloc interfaces + HookBloc for Dart and Flutter

Repository
View/report issues

License

MIT (LICENSE)

Dependencies

meta

More

Packages that depend on single_bloc_base