Setting up the project
In this chapter, we will learn how to use platform-specific widgets to build a simple Settings application. The application will accept user input for several groups of fields and allow the user to change their theme from the system setting to either light or dark mode.
When we have finished, the resulting application should mirror Figure 4.2, which shows the same application but with two different platform-specific designs:
Figure 4.2 – Settings app
We will start with an example that displays an empty page and includes classes to update each application setting. We will first update this sample to display platform-specific messages to the user. We will then update the application to display a platform-specific UI when running on an Android or iOS device.
After downloading the initial application from GitHub, we can start by moving into its root directory and running the flutter pub get
command from the terminal. This will...