Making sense of all those Flutter Providers

Suragch
Flutter Community
Published in
11 min readOct 30, 2019

--

ErikaWittlieb from Pixabay

Although the official Flutter site (in Simple app state management) says that the Provider package “is easy to understand,” I haven’t found that to always be the case. I think the main cause is the sheer number of Provider types there are:

  • Provider
  • ListenableProvider
  • ChangeNotifierProvider
  • ValueListenableProvider
  • StreamProvider
  • FutureProvider
  • MultiProvider
  • ProxyProvider
  • ChangeNotifierProxyProvider
  • and more

I just want to manage my app state in an easy way. Why are there so many choices? Which one am I supposed to use? Where do I start?

The purpose of this article is to help you understand what each of the main Provider types are for. I’ll give a minimal example of how each one is used. Then when you understand the differences, you can decide for yourself if and how you want to use the Provider package to manage app state in your project.

Setup

I’m going to use the following layout in the examples below:

--

--