diff --git a/lib/models/player_controller.dart b/lib/models/player_controller.dart index 3d9b8b2..7d1b0b0 100644 --- a/lib/models/player_controller.dart +++ b/lib/models/player_controller.dart @@ -72,7 +72,6 @@ class PlayerController extends GetxController { if (song.audioLocation == AudioLocation.asset) { src = AssetSource(song.audioPath); } else if (song.audioLocation == AudioLocation.local) { - log.d(song.audioPath); if (await File(song.audioPath).exists()) { src = DeviceFileSource(song.audioPath); } else { diff --git a/lib/pages/song.dart b/lib/pages/song.dart index c109a9b..4a049f7 100644 --- a/lib/pages/song.dart +++ b/lib/pages/song.dart @@ -88,7 +88,7 @@ class _SongPageState extends State { ); } - void showAdjustLyricSpeedOverlay(BuildContext context, Song song) { + void showAdjustLyricSpeedOverlay(BuildContext context) { OverlayState overlayState = Overlay.of(context); overlayEntry = OverlayEntry( builder: (context) => Positioned( @@ -105,7 +105,7 @@ class _SongPageState extends State { borderRadius: BorderRadius.circular(CTheme.borderRadius * 4), ), child: Center( - child: buildAdjustLyricSpeed(context, song), + child: buildAdjustLyricSpeed(context), ), ), ), @@ -114,12 +114,14 @@ class _SongPageState extends State { overlayState.insert(overlayEntry!); } - Widget buildAdjustLyricSpeed(BuildContext context, Song song) { + Widget buildAdjustLyricSpeed(BuildContext context) { return Row( mainAxisAlignment: MainAxisAlignment.center, children: [ IconButton( onPressed: () async { + final song = playlistController + .playlist[playlistController.currentSongIndex!]; await song.updateLyricTimeOffset(LyricUpdateType.forward); song.updateLyrics(); songLyricController.updateControllerWithForceUpdateLyricWidget(); @@ -129,6 +131,8 @@ class _SongPageState extends State { const SizedBox(width: CTheme.padding * 5), IconButton( onPressed: () async { + final song = playlistController + .playlist[playlistController.currentSongIndex!]; await song.updateLyricTimeOffset(LyricUpdateType.reset); song.updateLyrics(); songLyricController.updateControllerWithForceUpdateLyricWidget(); @@ -138,6 +142,8 @@ class _SongPageState extends State { const SizedBox(width: CTheme.padding * 5), IconButton( onPressed: () async { + final song = playlistController + .playlist[playlistController.currentSongIndex!]; await song.updateLyricTimeOffset(LyricUpdateType.backword); song.updateLyrics(); songLyricController.updateControllerWithForceUpdateLyricWidget(); @@ -524,11 +530,7 @@ class _SongPageState extends State { if (!isInitShowAdjustLyricSpeedOverlay) { isInitShowAdjustLyricSpeedOverlay = true; - showAdjustLyricSpeedOverlay( - context, - playlistController - .playlist[playlistController.currentSongIndex!], - ); + showAdjustLyricSpeedOverlay(context); } }, icon: const Icon(Icons.adjust_rounded),