_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.
The cubit package is a collection of different packages for cubit such as cubit, flutter cubit,** hydrated cubit**,** replay cubit**,** cubit test**, and a** cubit angular **and all these have their own functionalities that they bring in the scenario.
In all these packages the main package cubit used if you have plain old dart project and want to use functionalities of cubit state management.
flutter cubit consists of all the functionalities of the main cubit package and also provides other different functionalities for different kinds of widgets and one important thing it also uses the functionalities of provider package.
It persists and restores data in the hive database and you can get the data and read it out after you have restarted your application.
It allows you to redo and undo certain states, for example, you if want to delete your data or want to retrieve it again.
Remaining two packages cubit test is used for testing the framework and cubit angular is used in the angular framework
#cubit #state-management #provider #bloc #flutter