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

discontinued
outdated

A cubit is a subset of package:bloc which has no notion of events and relies on methods to emit new states.

Cubit

Pub build coverage

WARNING: This is highly experimental

A cubit is a subset of bloc which has no notion of events and relies on methods to emit new states.

Every cubit requires an initialState which will be the state of the cubit before emit has been called. The current state of a cubit can be accessed via the state getter.

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()..increment();
  await cubit.close();
}

Dart Versions #

  • Dart 2: >= 2.7.0

Maintainers #

118
likes
0
pub points
71%
popularity

Publisher

verified publisherbloc-dev.com

A cubit is a subset of package:bloc which has no notion of events and relies on methods to emit new states.

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

meta

More

Packages that depend on cubit