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.
Adds the provider package to a Flutter app and shows how to handle state with it, the usual first step beyond setState.
A lesson from a Riverpod series on how a widget talks to providers through ref, and when to use watch, read or listen.
Introduces Bloc state management, explains how it differs from Cubit, and builds examples with both.
A longer course on Bloc and Cubit through four projects, covering BlocProvider, BlocBuilder, BlocConsumer, BlocListener and when to choose Bloc over Cubit.