Flutter State Management: Riverpod, Bloc and Plain ValueNotifier

Notes on choosing between Riverpod, Bloc and Flutter's built-in ValueNotifier for small apps, and when the heavier options are worth it.

· 2 min read · Erik Kubica

Ask three Flutter developers how to manage application state and you'll probably get three different answers.

One will favour BLoC with RxDart streams. Another will prefer Riverpod with code generation. A third will like signals or MobX. They all have good reasons, and in my experience each of them works well in the right project.

I've shipped Flutter apps to a few hundred thousand iOS and Android users over the past five years. When I review codebases, the thing I notice most often is not the wrong library but more abstraction than a small app needs.

The Ceremony of a Simple Toggle

Suppose your mobile app has a settings screen where the user toggles a dark mode switch.

With a strict BLoC setup, this single boolean switch would typically involve: 1. theme_event.dart with a ToggleThemeEvent class extending an equatable base. 2. theme_state.dart with ThemeInitial, ThemeLoading, and ThemeLoaded classes. 3. theme_bloc.dart with an event transformer map, async event handlers, and stream emissions. 4. theme_provider.dart wiring the bloc into the widget tree.

That's four files and about seventy lines to flip a boolean. For a larger team this structure can pay off with consistency and testability. For a small app, I've found it slows down newer developers, who have to follow an event bus and stream subscriptions across several files to see why a button didn't update.

In a small app, it's worth asking whether the structure helps you more than it costs.

A Simpler Alternative

Flutter already ships with state primitives that are easy to overlook. Dart's ValueNotifier and ListenableBuilder need no third-party dependencies, no code generation and no extra classes:

class ThemeController extends ValueNotifier<bool> {
  ThemeController() : super(false);

  void toggleTheme() {
    value = !value;
  }
}

class ThemeToggleWidget extends StatelessWidget {
  final ThemeController controller;
  const ThemeToggleWidget({super.key, required this.controller});

  @override
  Widget build(BuildContext context) {
    return ListenableBuilder(
      listenable: controller,
      builder: (context, _) {
        return Switch(
          value: controller.value,
          onChanged: (_) => controller.toggleTheme(),
        );
      },
    );
  }
}

When controller.toggleTheme() fires, only the ListenableBuilder closure rebuilds and the parent tree is untouched. In my test the frame stayed within Flutter's 16 ms budget at 60 fps, with the app using around 14 MB of RAM.

When to Pick What

Reactive state libraries are the right tool in some cases. If you're building a real-time trading screen or a multi-track audio sequencer with interdependent data streams, reactive pipelines make sense. A bigger team may also reasonably choose Bloc or Riverpod just to get one shared convention.

For an e-commerce catalog, a service booking app or a 25-screen business utility, I've had good results starting with simple controllers that are easy to read, and moving to something heavier only when the app outgrows them.

Users mostly care whether the checkout screen feels smooth, not which state management library is underneath. Pick what your team can maintain.

Tell me what you need built

Usually a reply within a day, by email or WhatsApp.