Module 07 of 12

State Management

Lessons

About This Module

Once an app grows past a handful of screens, setState and constructor parameters stop being enough. Several screens need the same data, business logic leaks into widgets, and changes become hard to trace. State management solutions give that shared state a clear home and a predictable way to change.

This module covers the three most widely used approaches. You'll start with Provider, which builds on ChangeNotifier and InheritedWidget to expose state to the widget tree. You'll then look at Riverpod, which removes Provider's dependence on the widget tree and introduces ref.watch, ref.read and ref.listen. The last two lessons cover Bloc and Cubit, which separate UI from business logic using events and states.

Watch the lessons in order, then continue on to Forms & User Input.

Lessons

4 videos
01

Flutter Provider Tutorial (State Management)

Adds the provider package to a Flutter app and shows how to handle state with it, the usual first step beyond setState.

02

Flutter Riverpod Tutorial Series #4 - ref deep dive: watch, read, listen

A lesson from a Riverpod series on how a widget talks to providers through ref, and when to use watch, read or listen.

03

Flutter Bloc tutorial the easy way

Introduces Bloc state management, explains how it differs from Cubit, and builds examples with both.

04

Flutter Bloc Tutorial For Beginners

A longer course on Bloc and Cubit through four projects, covering BlocProvider, BlocBuilder, BlocConsumer, BlocListener and when to choose Bloc over Cubit.