AsyncValue
This is a type provided by the Riverpod package. Diving into the documentation of it we can see that it's a "utility for safely manipulating asynchronous data" which is great because this is exactly what we are going to do!
AsyncValue provides three different "states" which are data, loading, and error. It also provides a lot of cool methods that we can utilize for cleaner and more safe UI code such as the .when method.
How would it be used?
Imagine you have a type declared in your state class such as an image URL that you are going to fetch from an API. You probably expect the API requests to either be successful, be in a loading state, or fail with some kind of error/exception. So in the case of a normal variable declared for that URL it could look something like this.
final string url;
But using AsyncValue is would be like this.
final AsyncValue<string>> url;