Is Change Notifier with Provider/Scoped Model a bad State Management solution for Flutter?

Issue

In my Flutter projects, I usually tend to use Provider together with Change Notifier both for Dependency Injection and State Management purposes, because I find it to be so much more intuitive and less boilerplate than other solutions, and I’ve never had any problem with using this approach. But lately, I’ve been reading a lot about other State Management approaches and i’ve been hearing a lot of people saying that Change Notifier is basically a bad and less performatic solution for State Management, specially in large-sized apps. Like I said, I’ve never had any problems with Provider and Change Notifier myself, but I’m still a Junior dev, so… Anyway, is this really the case? If so, what exactly are the problems we can expect from using Provider and Change Notifier? What other State Management solutions are recommended for Flutter right now?

Solution

If you are talking about ChangeNotifier+provider, no.

This is misinformation that was spread due to a lack of understanding on how provider works.

The root of the misinformation is the documentation of ChangeNotifier that says it’s optimized for only a small number of listeners.

What some people misunderstood is that, with provider, a ChangeNotifier typically has only a single listener. So the issue doesn’t exist.

Answered By – Rémi Rousselet

Answer Checked By – Pedro (FlutterFixes Volunteer)

Leave a Reply

Your email address will not be published.