✨ Skip next & prev
This commit is contained in:
@ -7,6 +7,7 @@ import 'package:flutter/foundation.dart';
|
||||
import 'package:rhythm_box/platform.dart';
|
||||
import 'package:rhythm_box/services/local_track.dart';
|
||||
import 'package:rhythm_box/services/server/server.dart';
|
||||
import 'package:rhythm_box/widgets/tracks/querying_track_info.dart';
|
||||
import 'package:spotify/spotify.dart' hide Playlist;
|
||||
import 'package:rhythm_box/services/audio_player/custom_player.dart';
|
||||
import 'dart:async';
|
||||
|
@ -89,14 +89,17 @@ class RhythmAudioPlayer extends AudioPlayerInterface
|
||||
int get currentIndex => _mkPlayer.state.playlist.index;
|
||||
|
||||
Future<void> skipToNext() async {
|
||||
Get.find<QueryingTrackInfoProvider>().isQueryingTrackInfo.value = true;
|
||||
await _mkPlayer.next();
|
||||
}
|
||||
|
||||
Future<void> skipToPrevious() async {
|
||||
Get.find<QueryingTrackInfoProvider>().isQueryingTrackInfo.value = true;
|
||||
await _mkPlayer.previous();
|
||||
}
|
||||
|
||||
Future<void> jumpTo(int index) async {
|
||||
Get.find<QueryingTrackInfoProvider>().isQueryingTrackInfo.value = true;
|
||||
await _mkPlayer.jump(index);
|
||||
}
|
||||
|
||||
|
@ -32,7 +32,7 @@ class SourcedTrackProvider extends GetxController {
|
||||
|
||||
sourcedTrack.value = await SourcedTrack.fetchFromTrack(track: track);
|
||||
|
||||
if (isCurrentTrack) query.isQueryingTrackInfo.value = false;
|
||||
query.isQueryingTrackInfo.value = false;
|
||||
|
||||
return sourcedTrack.value;
|
||||
}
|
||||
|
Reference in New Issue
Block a user