Flutter-AssetsAudioPlayer icon indicating copy to clipboard operation
Flutter-AssetsAudioPlayer copied to clipboard

What do I need to clean up after using Assets Audio Player?

Open davoutuk opened this issue 2 years ago • 0 comments

It's not clear to me what I need to do when using Asssets Audio Player iin terms of freeing/releasing resources.

For example, I have the following standalone method in one of my classes...

  Future<void> _playWarning() async {
    final aPlayer = AssetsAudioPlayer();
    try {
      await aPlayer.open(Audio(PomodoroSoundAssets.getWarning()) );
      await aPlayer.play();
    } catch (t) {
      //stream unreachable
    }
  }

.... should I include a 'finally' block that releases something?  

davoutuk avatar Oct 28 '23 10:10 davoutuk