🐛 Bug fixes

This commit is contained in:
LittleSheep 2024-08-30 22:06:24 +08:00
parent 47d051dd44
commit fbb12ff801
4 changed files with 8 additions and 10 deletions

View File

@ -240,7 +240,7 @@ class _PlayerScreenState extends State<PlayerScreen> {
width: 56,
height: 56,
child: IconButton.filled(
icon: _isFetchingActiveTrack
icon: (_isFetchingActiveTrack && _isPlaying)
? const SizedBox(
height: 20,
width: 20,
@ -255,9 +255,7 @@ class _PlayerScreenState extends State<PlayerScreen> {
: Icons.pause,
size: 28,
),
onPressed: _isFetchingActiveTrack
? null
: _togglePlayState,
onPressed: _togglePlayState,
),
),
),

View File

@ -25,12 +25,12 @@ class ActiveSourcedTrackProvider extends GetxController {
try {
if (state.value == null) return;
await audioPlayer.pause();
await populateSibling();
final newTrack = await state.value!.swapWithSibling(sibling);
if (newTrack == null) return;
state.value = newTrack;
await audioPlayer.pause();
final playback = Get.find<AudioPlayerProvider>();
final oldActiveIndex = audioPlayer.currentIndex;
@ -40,12 +40,11 @@ class ActiveSourcedTrackProvider extends GetxController {
await audioPlayer.removeTrack(oldActiveIndex);
await playback.jumpToTrack(newTrack);
await audioPlayer.resume();
} catch (e, stack) {
log('[Playback] Failed to swap with siblings. Error: $e; Trace:\n$stack');
} finally {
query.isQueryingTrackInfo.value = false;
await audioPlayer.resume();
}
}
}

View File

@ -47,18 +47,19 @@ class _PlayerControlsState extends State<PlayerControls> {
onPressed: _isFetchingActiveTrack ? null : audioPlayer.skipToNext,
),
IconButton.filled(
icon: _isFetchingActiveTrack
icon: (_isFetchingActiveTrack && _isPlaying)
? const SizedBox(
height: 20,
width: 20,
child: CircularProgressIndicator(
strokeWidth: 3,
color: Colors.white,
),
)
: Icon(
!_isPlaying ? Icons.play_arrow : Icons.pause,
),
onPressed: _isFetchingActiveTrack ? null : _togglePlayState,
onPressed: _togglePlayState,
),
if (MediaQuery.of(context).size.width >= 720)
IconButton(

View File

@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
# In Windows, build-name is used as the major, minor, and patch parts
# of the product and file versions while build-number is used as the build suffix.
version: 1.0.0+1
version: 1.0.0+3
environment:
sdk: ^3.5.0