Email copiado — support@tuurt.com
Cargando experiencia
flutter · October 24, 2026 · 6 min

Riverpod vs Bloc in a Mid-Sized Flutter App: What Changes as the Team Grows

We evaluated Riverpod and Bloc on new features of a Flutter app we maintain. What mattered most wasn't code volume, but how many different ways a new developer has to solve the same problem.

By Tuurt Team

Riverpod vs Bloc in a mid-sized Flutter app: what actually changes as the team grows

When a Flutter app has a handful of screens and one person maintains it, choosing between Riverpod and Bloc is almost cosmetic: either one solves the problem of sharing state across widgets without threading callbacks through ten layers. The problem shows up later, once the app grows into several features with state shared across them and the team stops being one person. At that point the question is no longer which framework is more powerful in the abstract, it's which one behaves better when someone who didn't write the original code has to read it, extend it, or debug it on a Friday at five.

We maintain mid-sized Flutter apps originally built with Bloc, and for the newest features we evaluated, case by case, whether to stay in Bloc or write that part with Riverpod. There was no single winner, but the reasons each one won in its own cases say more than any generic comparison of the two frameworks would.

What Riverpod gets right

Riverpod removes BuildContext as a requirement for reading state. A provider is declared once, globally, and any widget reads it with ref.watch without a BlocProvider wrapping the widget tree up to that point:

final cartProvider = NotifierProvider<CartNotifier, CartState>(
  CartNotifier.new,
);

class CartNotifier extends Notifier<CartState> {
  @override
  CartState build() => CartState.empty();

  void addProduct(Product product) {
    state = state.copyWith(items: [...state.items, product]);
  }
}

That has a concrete advantage: the compiler catches type errors at build time that an InheritedWidget-based pattern relying on context lookups can leave hidden until runtime. If a provider doesn't exist or the type doesn't match, the project fails to compile instead of failing in production. On top of that, ref.watch inside a provider lets you compose derived state from other providers without the ceremony of listening to multiple streams by hand, which for state that depends on several sources -the cart total depends on the cart itself and on a separate active-discounts provider, for instance- cuts a fair amount of code compared to combining streams from several blocs.

What Bloc gets right

Bloc forces every state change to be modeled as an explicit transition between an input event and an output state, with no shortcuts:

sealed class CartEvent {}
class AddProduct extends CartEvent {
  final Product product;
  AddProduct(this.product);
}

class CartBloc extends Bloc<CartEvent, CartState> {
  CartBloc() : super(CartState.empty()) {
    on<AddProduct>((event, emit) {
      emit(state.copyWith(items: [...state.items, event.product]));
    });
  }
}

That rigidity means more code than writing a method that mutates state directly, but it has a payoff that only shows up over time: every state change in the app ends up logged as a named event, and Bloc exposes an onTransition hook that logs each event along with the previous and next state without anyone having to instrument it by hand. When something went wrong in production and we need to reconstruct the exact sequence of what the user did before the state became inconsistent, that named transition log is the difference between finding the bug in minutes and guessing at it.

Where team growth actually bites, and it wasn't where we expected

We went into this evaluation expecting the deciding factor to be how much code each feature takes to write. It wasn't. Riverpod clearly wins on code volume for almost any feature. The factor that ended up mattering more was how many equally valid ways, as far as the framework is concerned, a new developer has to solve the same problem.

Riverpod ships several provider types -Provider, NotifierProvider, AsyncNotifierProvider, StreamProvider, with .autoDispose and .family variants- and the framework doesn't dictate which one fits which situation. That's a strength when the person designing the architecture knows exactly which provider fits each case, and a real problem when two new developers, working on different features at the same time, solve the same kind of problem -state derived from an async call- with two different patterns because neither one saw how the other solved it. The result isn't an immediate bug, it's a codebase where "how async state is handled around here" no longer has one answer, and every new hire has to learn the actual convention by reading several unrelated features instead of reading the framework's docs.

We ran into this less with Bloc, not because the team was more disciplined, but because the framework leaves less room for variation: one event, one state, one on<Event>. A new developer who understood one bloc understands the shape of every bloc in the project, because the shape is the same by design. The cost is that writing that shape for a trivial state change -showing or hiding a UI element that doesn't need to persist or have history- feels like a disproportionate amount of ceremony for the problem at hand, and more than one new hire genuinely asked whether a purely local UI toggle really needed its own event and state.

What didn't change with team size: testing

On testing, both behave well, and that gap didn't move as the team grew. bloc_test lets you describe a test as a sequence of events and an expected list of emitted states, which reads almost like executable documentation:

blocTest<CartBloc, CartState>(
  'adds a product to the cart',
  build: () => CartBloc(),
  act: (bloc) => bloc.add(AddProduct(product)),
  expect: () => [CartState(items: [product])],
);

With Riverpod, a ProviderContainer with overrides plays the same role, though it requires whoever writes the test to understand which providers depend on which so they only override what's necessary:

test('adds a product to the cart', () {
  final container = ProviderContainer();
  container.read(cartProvider.notifier).addProduct(product);
  expect(container.read(cartProvider).items, [product]);
});

Neither one got harder to test as more developers started writing tests; how hard a Riverpod test is depends on how many providers are chained together, not on how many people wrote them.

What we decided, feature by feature

We didn't migrate the whole app in one direction. Flows where the exact history of what happened matters for debugging -checkout, multi-step forms with conditional validation, anything where support needs to reconstruct what a user actually did- stay in Bloc, precisely because the rigidity that's annoying for a UI toggle is the same rigidity that gives you traceability for free when something breaks. Local UI state and derived state that combines several sources without needing history -list filters, a simple form's state, cached API data- we write in Riverpod, where the smaller code footprint outweighs traceability we don't need there anyway.

What we check before picking one for a new feature

Before writing a new feature in Riverpod or Bloc, we first ask whether someone will need to reconstruct the exact sequence of state changes to debug an issue a user reported, because if the answer is yes, Bloc's free traceability outweighs the extra code it demands. If the answer is no, we look at how many distinct sources that state combines, since that's where Riverpod's provider composition cuts real code with no traceability cost we'd miss. Either way, we write down the convention we chose for that kind of problem -which provider type to use for async state, when a bloc is actually worth it for something small- in a short project guide, because the real problem we ran into wasn't that one framework beat the other, it was that neither one, on its own, stops two new developers from solving the same problem two different ways if nobody wrote the convention down anywhere.

flutter riverpod bloc dart
← Back to blog