This commit is contained in:
rang 2025-12-25 17:47:49 +08:00
parent ead8850b2e
commit 0a26871bb1
6 changed files with 183 additions and 26 deletions

View file

@ -0,0 +1,7 @@
import 'package:flutter/material.dart';
extension TextStyleExtension on TextStyle {
double get calculateHeight {
return (height ?? 0) * (fontSize ?? 0);
}
}

View file

@ -213,10 +213,12 @@ class _BookOnShelfPlayButton extends HookConsumerWidget {
Widget build(BuildContext context, WidgetRef ref) {
final me = ref.watch(meProvider);
final currentBook = ref.watch(currentBookProvider);
final playing = ref.watch(playerStateProvider.select((v) => v.playing));
final playerStateNotifier = ref.watch(playerStateProvider.notifier);
final isLoading = playerStateNotifier.isLoading(libraryItemId);
final isCurrentBookSetInPlayer =
currentBook?.libraryItemId == libraryItemId;
final isPlayingThisBook = playing && isCurrentBookSetInPlayer;
final isPlayingThisBook =
playerStateNotifier.isPlaying() && isCurrentBookSetInPlayer;
final userProgress = me.valueOrNull?.mediaProgress
?.firstWhereOrNull((element) => element.libraryItemId == libraryItemId);
@ -298,7 +300,7 @@ class _BookOnShelfPlayButton extends HookConsumerWidget {
icon: Hero(
tag: HeroTagPrefixes.libraryItemPlayButton + libraryItemId,
child: DynamicItemPlayIcon(
// isLoading: isLoading,
isLoading: isLoading,
isBookCompleted: isBookCompleted,
isPlayingThisBook: isPlayingThisBook,
isCurrentBookSetInPlayer: isCurrentBookSetInPlayer,