Sparround

The landscape of approaches and how to choose

The Flutter team does not recommend one state management solution. The official docs say the best choice depends on the app's complexity, your team's preferences, and the specific problems you need to solve, and they state outright that the topic is complex and the described approach may not fit your case.

That nuance matters in interviews: the "right" answer is not a library name but the reasoning behind the choice.

CriterionProviderRiverpodBLoC / Cubit
Where providers liveIn the widget tree (`MultiProvider`)Outside the tree, as global `final` variablesIn the tree (`BlocProvider`), backed by package:provider
ReadingBy type: `context.watch<T>()`By object: `ref.watch(myProvider)`By type: `context.read<T>()`, `BlocBuilder<B, S>`
Reading a missing providerA runtime error (not found in the tree)Visible at compile time — a provider is a concrete objectA runtime error (`BlocProvider` not found)
Async stateManual: `FutureProvider` or flags inside the modelBuilt-in `AsyncValue`: loading/error/data out of the boxManual in the state model: a status enum or sealed classes
TraceabilityWeak — you can't see who called `notifyListeners`Possible via observersStrong — every state change is triggered by an event
BoilerplateThe leastMedium (less with codegen)The most (less with Cubit)

The official bloc docs name two concrete advantages of Bloc over Cubit: traceability (knowing the sequence of state changes and exactly what triggered them) and advanced event transformations (reactive operators such as debounce or throttle via EventTransformer). That is the most precise answer to "why BLoC?" — not "it's better", but those two specific capabilities.

A practical decision order — useful for thinking aloud in an interview:

  • Team and codebase size. One developer, five screens → Provider or plain Riverpod. Ten-plus developers on a long-lived product → something that enforces structure (BLoC, or Riverpod with codegen plus lints).
  • How much of the app is async. If most screens load from the network, AsyncValue with automatic caching and retry is a large win.
  • Audit requirements. Fintech, insurance, payment flows — an event log and BlocObserver tracing carry real value.
  • Existing code. Introducing BLoC into a Provider codebase means two paradigms; without a migration plan that is technical debt.
  • Hiring reality. The skills most asked for are Provider, Riverpod and BLoC — picking an exotic library becomes a cost when the team changes.

📚 Sources and documentation