Automatically play next music
This commit is contained in:
parent
fb573cfc7c
commit
0cdb9a6c27
@ -50,8 +50,11 @@ class _MusicPlayerState extends State<MusicPlayer> {
|
||||
_playNext();
|
||||
});
|
||||
|
||||
audioPlayer.onPlayerStateChanged
|
||||
.listen((s) => setState(() => {_playerState = s}));
|
||||
audioPlayer.onPlayerStateChanged.listen((s) => setState(() {
|
||||
_playerState = s;
|
||||
|
||||
if (_playerState == PlayerState.COMPLETED) _playNext();
|
||||
}));
|
||||
}
|
||||
|
||||
Future<void> _play() async {
|
||||
|
Loading…
Reference in New Issue
Block a user