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
04fe06d1ac
commit
bd9e985697
13 changed files with 1036 additions and 878 deletions
11
lib/shared/extensions/box.dart
Normal file
11
lib/shared/extensions/box.dart
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import 'package:hive_ce/hive.dart';
|
||||
|
||||
extension BoxExtension on Box {
|
||||
T? getAs<T>(dynamic key, {String? defaultValue}) {
|
||||
final value = get(key, defaultValue: defaultValue);
|
||||
if (value is T) {
|
||||
return value;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -287,17 +287,13 @@ class _BookOnShelfPlayButton extends HookConsumerWidget {
|
|||
),
|
||||
),
|
||||
onPressed: () async {
|
||||
final book =
|
||||
await ref.watch(libraryItemProvider(libraryItemId).future);
|
||||
|
||||
// ref.read(currentBookProvider.notifier).update(
|
||||
ref.read(currentBookProvider.notifier).update(libraryItemId);
|
||||
// final book =
|
||||
// await ref.watch(libraryItemProvider(libraryItemId).future);
|
||||
// ref.read(absPlayerProvider.notifier).load(
|
||||
// book.media.asBookExpanded,
|
||||
// userProgress?.currentTime,
|
||||
// initialPosition: userProgress?.currentTime,
|
||||
// );
|
||||
ref.read(absPlayerProvider.notifier).load(
|
||||
book.media.asBookExpanded,
|
||||
initialPosition: userProgress?.currentTime,
|
||||
);
|
||||
},
|
||||
icon: Hero(
|
||||
tag: HeroTagPrefixes.libraryItemPlayButton + libraryItemId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue