When you close a flutter app via the back button on Android, there are some problems concerning plugins. The dart/flutter side of the plugin gets restarted, the android part not. This causes trouble, especially with background activities like playing audio. I think it is a critical issue so I created a GitHub issue: https://github.com/flutter/flutter/issues/31734
I want to do a workaround, so if the app gets closed via the back button, the playback should get stopped.
I tried to detect the back button close action via the
didChangeAppLifecycleState method. But there I can determine if it is a normal close action or with the back button.