mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-16 14:29:35 +00:00
123
This commit is contained in:
parent
ead8850b2e
commit
0a26871bb1
6 changed files with 183 additions and 26 deletions
7
lib/shared/extensions/style.dart
Normal file
7
lib/shared/extensions/style.dart
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
import 'package:flutter/material.dart';
|
||||
|
||||
extension TextStyleExtension on TextStyle {
|
||||
double get calculateHeight {
|
||||
return (height ?? 0) * (fontSize ?? 0);
|
||||
}
|
||||
}
|
||||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue