mirror of
https://github.com/Dr-Blank/Vaani.git
synced 2026-02-16 14:29:35 +00:00
恢复
This commit is contained in:
parent
1ca8e4889a
commit
aad510ea45
31 changed files with 777 additions and 239 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
||||
import 'package:vaani/features/per_book_settings/providers/book_settings_provider.dart';
|
||||
import 'package:vaani/features/player/providers/audiobook_player.dart';
|
||||
import 'package:vaani/features/player/providers/currently_playing_provider.dart';
|
||||
import 'package:vaani/features/skip_start_end/core/skip_start_end.dart' as core;
|
||||
|
||||
part 'skip_start_end_provider.g.dart';
|
||||
|
|
@ -9,9 +10,9 @@ part 'skip_start_end_provider.g.dart';
|
|||
class SkipStartEnd extends _$SkipStartEnd {
|
||||
@override
|
||||
core.SkipStartEnd? build() {
|
||||
final session = ref.watch(sessionProvider);
|
||||
final bookId = session?.libraryItemId;
|
||||
if (session == null || bookId == null) {
|
||||
final currentBook = ref.watch(currentBookProvider);
|
||||
final bookId = currentBook?.libraryItemId;
|
||||
if (currentBook == null || bookId == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
@ -32,28 +33,3 @@ class SkipStartEnd extends _$SkipStartEnd {
|
|||
return skipStartEnd;
|
||||
}
|
||||
}
|
||||
|
||||
// @riverpod
|
||||
// class SkipStartEnd extends _$SkipStartEnd {
|
||||
// @override
|
||||
// core.SkipStartEnd? build() {
|
||||
// final player = ref.watch(simpleAudiobookPlayerProvider);
|
||||
// final book = ref.watch(audiobookPlayerProvider.select((v) => v.book));
|
||||
// final bookId = book?.libraryItemId ?? '_';
|
||||
// if (bookId == '_') {
|
||||
// return null;
|
||||
// }
|
||||
// final bookSettings = ref.watch(bookSettingsProvider(bookId));
|
||||
// final start = bookSettings.playerSettings.skipChapterStart;
|
||||
// final end = bookSettings.playerSettings.skipChapterEnd;
|
||||
|
||||
// final skipStartEnd = core.SkipStartEnd(
|
||||
// start: start,
|
||||
// end: end,
|
||||
// player: player,
|
||||
// chapterId: player.currentChapter?.id,
|
||||
// );
|
||||
// ref.onDispose(skipStartEnd.dispose);
|
||||
// return skipStartEnd;
|
||||
// }
|
||||
// }
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ part of 'skip_start_end_provider.dart';
|
|||
// RiverpodGenerator
|
||||
// **************************************************************************
|
||||
|
||||
String _$skipStartEndHash() => r'6df119db598c6e8673dcea090ad97f5affab4016';
|
||||
String _$skipStartEndHash() => r'ba92dd22fc76f04cb5aaa220d025eb69c9d2ba46';
|
||||
|
||||
/// See also [SkipStartEnd].
|
||||
@ProviderFor(SkipStartEnd)
|
||||
|
|
|
|||
|
|
@ -2,10 +2,10 @@ import 'package:flutter/material.dart';
|
|||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:icons_plus/icons_plus.dart';
|
||||
import 'package:vaani/features/per_book_settings/providers/book_settings_provider.dart';
|
||||
import 'package:vaani/features/player/providers/audiobook_player.dart';
|
||||
import 'package:vaani/features/player/providers/currently_playing_provider.dart';
|
||||
import 'package:vaani/features/player/view/player_expanded.dart';
|
||||
import 'package:vaani/generated/l10n.dart';
|
||||
import 'package:vaani/features/settings/view/notification_settings_page.dart';
|
||||
import 'package:vaani/generated/l10n.dart';
|
||||
|
||||
class SkipChapterStartEndButton extends HookConsumerWidget {
|
||||
const SkipChapterStartEndButton({super.key});
|
||||
|
|
@ -46,9 +46,9 @@ class PlayerSkipChapterStartEnd extends HookConsumerWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final session = ref.watch(sessionProvider);
|
||||
final bookId = session?.libraryItemId ?? '_';
|
||||
final bookSettings = ref.watch(bookSettingsProvider(bookId));
|
||||
final currentBook = ref.watch(currentBookProvider);
|
||||
final bookId = currentBook?.libraryItemId ?? '_';
|
||||
final bookSettings = ref.read(bookSettingsProvider(bookId));
|
||||
return Scaffold(
|
||||
body: Column(
|
||||
children: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue