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

discontinuedreplaced by: bloc
outdated

Cubit is a lightweight state management solution. It is a subset of the bloc package that does not rely on events and instead uses methods to emit new states.

Cubit

Pub build coverage Star on GitHub License: MIT Starware

Cubit is a lightweight state management solution. It is a subset of the bloc package that does not rely on events and instead uses methods to emit new states.

Every cubit requires an initial state 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(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 #

Starware #

Cubit is Starware.
This means you're free to use the project, as long as you star its GitHub repository.
Your appreciation makes us grow and glow up. ⭐

118
likes
0
pub points
66%
popularity

Publisher

verified publisherbloc-dev.com

Cubit is a lightweight state management solution. It is a subset of the bloc package that does not rely on events and instead uses methods to emit new states.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

meta

More

Packages that depend on cubit