The Riverpod Library

Riverpod for state management

Riverpod is another state management package library like Provider.

We’ve already learned how to use the most popular Flutter package, Provider, for state management. In this chapter we will learn to use Riverpod to manage Flutter state in a better way.

Why do we need the Riverpod when we already have the Provider library? Afterall, we showed earlier that the Provider state management package reduces widget-rebuilds.

However, in the Flutter community, developers started to complain that the Provider package had some limitations. One of these complaints is that it does not compile safely. Another insufficiency was poor dependency injection. All of these limitations came from the same reason: the Provider package depends on the Flutter framework because it is a wrapper class of inherited widgets.

The answer to these limitations is Riverpod.

Moreover, Riverpod is easy to maintain, test, and much less error-prone. It was even created by the same person, Remi Rousselet.

The many options in Riverpod

Get hands-on with 1200+ tech skills courses.