Flutter Riverpod tutorial: Counter app

Suragch
Flutter Community
Published in
10 min readOct 12, 2020

--

Step-by-step instructions to help set up your first Riverpod project

Riverpod

It’s hard to choose a state management solution for Flutter because everyone is recommending different things. Truthfully, you can probably make any of the state management options work. I’m not here to argue that Riverpod is the best, but you’re here, so you must at least be interested in Riverpod. My goal is to help you get up and running.

Riverpod and Provider are syntax heavy and that makes them difficult to learn. This tutorial takes an opinionated position. Rather than telling you about all of the possible ways you can use Riverpod, it will tell you how to use Riverpod in one way only — a way that can be repeated in a wide range of use cases. Once you’ve mastered that way of using Riverpod, you can branch out into some of the other options that might be a better match for your particular use case. I believe this way of teaching will be the most beneficial to a beginner who doesn’t know where to start.

While the counter app is a frequently used example, it’s useful because it’s simple enough to be understandable but complex enough to demonstrate some of the principles of state management. I really like how the Bloc Library uses a series of app building tutorials to teach how to use that library. This article is the first in that same vein. The second…

--

--