← Flutter Reference

What is Cubit in Flutter?

State Management · Beginner

By Abdelrahman Saed — Senior Mobile Engineer. Last updated: 2026-08-10.

Cubit is a streamlined state management class in Flutter from the flutter_bloc library. It simplifies the BLoC pattern by replacing event classes with simple methods, making it easier to learn while preserving the same reactive state model and testability.

How it works

A Cubit exposes methods instead of events. You call a method, it runs some logic, and it emits a new state. The UI listens to the Cubit and rebuilds when the state changes.

Widget → Method call → Cubit → State → Widget

Compare the same counter, this time as a Cubit instead of a BLoC:

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

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

No event classes. No event-to-state mapping. Just methods that emit state. The UI uses the same BlocBuilder<CubitCubit, int> it would use with a full BLoC.

At iStoria, we use Cubit for features where the state logic is simple (settings, theme, simple CRUD screens) and full BLoC for features with complex event interactions (the learning flow, subscription paywall, leaderboard). The two coexist cleanly because Cubit extends BlocBase — the same base class — so the testing and tooling story is identical.

When to use it

Choose Cubit when:

  • The state logic is straightforward — a few methods, each doing one thing.
  • You want BLoC's testability without the event-class boilerplate.
  • You're prototyping and don't yet know which events you need — start with Cubit, migrate to BLoC if event tracing becomes necessary.

Choose full BLoC instead when:

  • You need an audit trail of user intents (events) for debugging or analytics.
  • Multiple events should trigger shared logic via event transformers.
  • The same event can produce different states depending on the current state and async results.

Strengths

  • Much less boilerplate than BLoC — no event classes needed
  • Same testability — every emit is a testable state transition
  • Same tooling — flutter_bloc devtools work identically
  • Easy migration path — a Cubit can become a BLoC when event granularity is needed
  • Gentler learning curve, making it ideal for teams new to reactive state management

Tradeoffs

  • No event trail — you lose the audit log of what the user did that BLoC events provide
  • Method calls are less explicit than events — harder to trace in complex flows
  • Not ideal for complex event-to-state transformations (event transformers, concurrent handling)

Alternatives

  • BLoC — BLoC (Business Logic Component) is a reactive state management pattern for Flutter that uses streams to separate business logic from UI. Learn how it works and when to use it.
  • Riverpod — Riverpod is a reactive caching and state management framework for Flutter that improves on Provider with compile-time safety, no BuildContext dependency, and auto-dispose.
  • GetX — GetX is an all-in-one Flutter framework providing state management, dependency injection, route management, and utilities. Popular for rapid prototyping, controversial for production.

Comparisons

Related articles

Related case studies

FAQ

Should I start with Cubit or BLoC?

Start with Cubit. It covers 80% of state management needs with far less boilerplate. Migrate specific features to full BLoC when you need event tracing, event transformers, or complex concurrency control. At iStoria, roughly half our Cubits are Cubits, not full BLoCs.

Can I mix Cubit and BLoC in the same app?

Yes — they share the same BlocBase interface, so BlocProvider, BlocBuilder, and BlocListener work identically with both. Most production apps mix them: Cubit for simple screens, BLoC for complex flows.


Available for hire. Abdelrahman Saed is a Senior Mobile Engineer (Flutter) — open to full-time, fractional, contract, or advisory work. Hire me →

Book a 20-minute call · Download the CV (PDF) · See how I work