cubit 0.0.5 copy "cubit: ^0.0.5" to clipboard
cubit: ^0.0.5 copied to clipboard

discontinued
outdated

An experimental Dart library which expose a cubit. A cubit is a reimagined bloc (from package:bloc) which removes events and relies on methods to emit new states instead.

Cubit

Pub build coverage

WARNING: This is highly experimental

An experimental Dart library which exposes a cubit. A cubit is a reimagined bloc (from package:bloc) which removes events and relies on methods to emit new states instead.

Creating a Cubit #

class CounterCubit extends Cubit<int> {
  CounterCubit() : super(initialState: 0);

  void increment() => emit(state + 1);
}

Consuming a Cubit #

void main() async {
  final cubit = CounterCubit()
    ..listen(print)
    ..increment();
  await cubit.close();
}

The above code outputs:

1

Dart Versions #

  • Dart 2: >= 2.7.0

Maintainers #

118
likes
0
pub points
71%
popularity

Publisher

verified publisherbloc-dev.com

An experimental Dart library which expose a cubit. A cubit is a reimagined bloc (from package:bloc) which removes events and relies on methods to emit new states instead.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

meta

More

Packages that depend on cubit