Riverpod – enhancing Provider
As Flutter frameworks got better with time, state management packages were also enhanced, and problems caused by older techniques were solved in newer ones. Riverpod is an enhancement of the Provider
package. It uses the concepts of Provider underneath and adds to the functionality by providing improved flexibility and performance. One major problem that Riverpod solved was having the possibility of reading null objects from the states. Reading objects in Riverpod is now compile-safe, so you are always sure that you won't get a null when reading objects from states using read
or watch
functions. You can read more about Riverpod and its documentation on its official website at https://riverpod.dev/.
In this section, you are going to learn how to consume a Riverpod
package inside your counter example application. You will also learn some new keywords that would be similar to the functionality discussed in the previous section.