Automatically stop audio on widget destruction

This commit is contained in:
Pierre HUBERT 2022-03-24 11:25:48 +01:00
parent 41feac8ef5
commit 30aa018bed

View File

@ -84,6 +84,12 @@ class _MusicPlayerState extends State<MusicPlayer> {
await _play();
}
@override
void dispose() {
super.dispose();
_stop();
}
@override
Widget build(BuildContext context) {
return LayoutBuilder(