"Which state management should I use in Flutter?" is the most common question I get, and the honest answer is: all three of these work. What matters is picking one deliberately and using it consistently. I have shipped production apps with BLoC, Riverpod, Provider and GetX, so here is how I actually decide.

The same feature three ways

The feature: load a list of products, show loading and error states.

BLoC

Events in, states out. Explicit and verbose, which is a feature on big teams.

dart
sealed class ProductsEvent {}
final class ProductsRequested extends ProductsEvent {}

sealed class ProductsState {}
final class ProductsLoading extends ProductsState {}
final class ProductsLoaded extends ProductsState {
  ProductsLoaded(this.items);
  final List<Product> items;
}
final class ProductsFailure extends ProductsState {
  ProductsFailure(this.message);
  final String message;
}

class ProductsBloc extends Bloc<ProductsEvent, ProductsState> {
  ProductsBloc(this._repo) : super(ProductsLoading()) {
    on<ProductsRequested>((event, emit) async {
      emit(ProductsLoading());
      try {
        emit(ProductsLoaded(await _repo.fetch()));
      } catch (e) {
        emit(ProductsFailure('$e'));
      }
    });
  }
  final ProductRepository _repo;
}

Riverpod

Providers are declarative and testable, and async state is built in.

dart
final productsProvider = FutureProvider<List<Product>>((ref) {
  return ref.watch(productRepositoryProvider).fetch();
});

// In the widget
final products = ref.watch(productsProvider);
return products.when(
  data: (items) => ProductList(items),
  loading: () => const CircularProgressIndicator(),
  error: (e, _) => ErrorView('$e'),
);

Provider (ChangeNotifier)

The simplest to read. It also leaves the most up to you.

dart
class ProductsNotifier extends ChangeNotifier {
  ProductsNotifier(this._repo);
  final ProductRepository _repo;

  List<Product> items = const [];
  bool loading = false;
  String? error;

  Future<void> load() async {
    loading = true;
    error = null;
    notifyListeners();
    try {
      items = await _repo.fetch();
    } catch (e) {
      error = '$e';
    }
    loading = false;
    notifyListeners();
  }
}

Notice the Provider version allows an impossible state: loading == true and error != null at once. BLoC's sealed states and Riverpod's AsyncValue make that unrepresentable.

Comparison

BLoCRiverpodProvider
BoilerplateHighLow to mediumLow
Impossible statesPrevented by sealed statesPrevented by AsyncValueEasy to create
TestingExcellent (bloc_test)Excellent (provider overrides)Good
Async handlingManualBuilt inManual
Onboarding a teamClear conventionsNeeds a learning curveEasiest
TraceabilityEvent log of every changeObservers availableLimited

How I choose

  • Large app, several developers, strict conventions: BLoC. The event and state types act as documentation, and every change is traceable.
  • Small team, lots of async data, fast iteration: Riverpod.
  • Small app or a few shared values: Provider is fine. Do not over-engineer.

Whatever you pick, keep it behind your architecture. If your widgets depend on use cases and repositories rather than on Dio, switching later is a presentation-layer change; see Clean Architecture in Flutter.

Mistakes I see repeatedly

  1. Mixing three state managers in one app because each tutorial used a different one.
  2. Business logic inside widgets. State management is where logic lives, not build.
  3. One giant state object for a whole screen. Split state by responsibility.
  4. Not testing it. The reason to adopt any of these is testability; see how to test Flutter apps.

Key takeaways

  • All three are production-ready. Consistency beats the "perfect" choice.
  • Model loading, success and error as one type so impossible states cannot exist.
  • Choose by team size and conventions, not by trend.

Working on a Flutter team that needs this kind of judgment? Contact me.