Technical requirements
To examine the source from this chapter, you can download it from https://github.com/PacktPublishing/Building-Games-with-Flutter/tree/main/chapter11.
In this chapter, we will save the user's preference for the music volume, so let's add the library for persisting this value in our game:
- Open the
pubspec.yaml
file and add the following dependency:shared_preferences: ^2.0.15
- Save the file and allow
pub get
to download this dependency and validate the assets:flutter pub get
In the next section, we will discuss the final code we need to add to the game to wrap things up, including the game screens and navigation.