koin_bloc 0.1.1

Dart native js
Flutter Android iOS web

A package to make it easier to use Bloc library with Koin.dart.

A package to make it easier to use Bloc library with Koin.dart.

Usage #

Create your Cubit or Bloc

class CounterCubit extends Cubit<int> {
  CounterCubit() : super(0);
}
// Your scope class
class MyScope {}

var cubitModule = Module()
  // Define a single cubit.
  // Single Cubit will be closed when the global context of the koin is closed.
  ..cubit((s) => CounterCubit())
  // Define a scoped cubit for MyScopeWidget.
  // Scoped Cubit will be closed when the scope instance is closed,
  //that is, when MyScopeWidget is removed from the widget tree
  ..scope<MyScope>((scope) {
    scope.scopedCubit<CounterCubit>((scope) => CounterCubit());
  });
0
likes
110
pub points
21%
popularity

A package to make it easier to use Bloc library with Koin.dart.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

pedro.bissonho@gmail.com

License

Apache 2.0 (LICENSE)

Dependencies

bloc, koin

More

Packages that depend on koin_bloc