Why use freezed?

Well, freezed can be used for both data classes and unions! This means you’ll get automatically generated value equality, copyWith , exhaustive switch, and even JSON serialization support from one place ! Basically you get built_value and sum_types without all the weirdness and boilerplate.

Read more

What is a cubit in BLoC?

A Cubit is similar to Bloc but has no notion of events and relies on 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.

Read more

Should I use BLoC or cubit?

Blocs are more verbose than Cubits . Additional boilerplate — shown in the example below — is needed for states and events. But, in my opinion, this is a price worth paying. In the long run, traceability is a precondition for the manageability of your app.

Read more