Passing data between screens
In almost all apps, there is the concept of application state. This is larger than the state within one widget as it travels with the user throughout the app. If you have worked with other frameworks, you will have seen varying ways to hold application state, and Flutter doesn’t have a single way to hold and share state.
We will look at options for how to store application state long term, such as in a cloud database, in Chapter 10, Popular Third-Party Plugins, but once the state has been retrieved from storage, how should you share that state among your many different application screens?
It’s worth noting that there is no right or wrong answer for state management, but every approach has benefits and weaknesses and you will need to decide which approach suits you from the maintenance, code readability, and app usage perspectives.
Passing state in widget parameters
The simplest way to share state around your app, and probably...