Loading topic
StatelessWidget and build method, and the idea of lifting state up. You should also have seen a provider declared as a top-level final variable. Here you will learn where provider state actually lives and how ProviderScope co4 min readProvider<T>, which exposes a value that your widgets can read but never change directly. It assumes you know Dart classes, generics and closures, and that you can write a Flutter StatelessWidget and its `b5 min readStatelessWidget and StatefulWidget. It also assumes you have a ProviderScope at the root of your app and have declared a simple Provider, as in the previous chapters. Here you learn how a widget gets access to a provider, what the WidgetRef obje5 min readConsumerWidget, declare a Provider and a NotifierProvider, and know that ProviderScope sits at the root of the app. The earlier chapters in this tutorial cover those. The chapter explains how ref.watch and ref.read differ, when each is correct, and wh4 min readConsumerWidget and WidgetRef, and know the difference between ref.watch and ref.read. Here you will build state that changes over time. A plain Provider is read-only, so it cannot do this.3 min readProvider and a NotifierProvider. It also assumes you know the difference between ref.watch and ref.read in a ConsumerWidget. Here you will build providers that compute their value from other providers, and you will see why that is usually bett4 min readasync functions, that you have used ProviderScope and ConsumerWidget, and that you know the difference between ref.watch and ref.read. It also assumes you have seen a synchronous Provider. Here you will load data that arrives later and show it safe5 min readNotifier, NotifierProvider, ref.watch and ref.read. It also assumes you know Dart Future and async/await, and that you have met AsyncValue through FutureProvider. You will learn how to load data in build, change it with methods, and refresh it. You w5 min readref.watch, ConsumerWidget, and Notifier from the earlier chapters. You should also know that Dart objects compare with ==, which defaults to identity unless a class overrides it.5 min readref.watch rebuilds a widget when a provider changes. Some changes should not rebuild anything. Showing a snackbar, navigating to another screen, logging an event, or resetting a related piece of state are side effects, and ref.listen is the tool for them. This chapter covers how it works, how it4 min readfamily, the modifier that turns one provider declaration into many independent provider states, one per argument. It assumes you know Provider, FutureProvider, ref.watch and AsyncValue.when from earlier chapters, and that you are comfortable with == and hashCode in 5 min readref.watch and ref.read, and use family. Code targets flutter_riverpod 2.x.4 min readNotifier and an AsyncNotifier, read providers with ref.watch and ref.read, and handle an AsyncValue in a widget. Earlier chapters showed each piece alone. Here you arrange them into a layout that stays readable as the app grows.4 min readProviderContainer, swapping dependencies with overrides, and widget tests with ProviderScope.3 min readref.watch, ref.read, Notifier, AsyncNotifier, family and autoDispose. It also assumes you are comfortable with Dart generics a5 min readProvider, Notifier, AsyncNotifier, family and autoDispose, and you should be comfortable with Dart generics and async/await. Code generation adds no new capabilities. It writes the same providers you have been dec4 min read