diff --git a/lib/ui/music_player.dart b/lib/ui/music_player.dart index 8d00b4a..f4a0fd8 100644 --- a/lib/ui/music_player.dart +++ b/lib/ui/music_player.dart @@ -50,8 +50,11 @@ class _MusicPlayerState extends State { _playNext(); }); - audioPlayer.onPlayerStateChanged - .listen((s) => setState(() => {_playerState = s})); + audioPlayer.onPlayerStateChanged.listen((s) => setState(() { + _playerState = s; + + if (_playerState == PlayerState.COMPLETED) _playNext(); + })); } Future _play() async {