dingDong function
- AudioPlayer player
Encapsulate the playing of the dong into its own function because of the need for it to be async through the await and it is called upon multiple times.
Implementation
Future<void> dingDong(AudioPlayer player) async {
// Always stop the player first in case there is some other audio still
// playing.
await player.stop();
await player.setVolume(bellVolume);
await player.play(dong);
}