From 4965f3ced333870196f28c757819b4a8b619a7be Mon Sep 17 00:00:00 2001 From: Emanuel Ferraz Date: Sun, 14 Jan 2024 17:04:11 +0000 Subject: [PATCH] Support swiping from first chapter to manga page --- .../presentation/reader/widgets/reader_wrapper.dart | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/src/features/manga_book/presentation/reader/widgets/reader_wrapper.dart b/lib/src/features/manga_book/presentation/reader/widgets/reader_wrapper.dart index 48449da6..bfd0c61c 100644 --- a/lib/src/features/manga_book/presentation/reader/widgets/reader_wrapper.dart +++ b/lib/src/features/manga_book/presentation/reader/widgets/reader_wrapper.dart @@ -423,6 +423,7 @@ class ReaderWrapper extends HookConsumerWidget { toggleVisibility: () => visibility.value = !visibility.value, scrollDirection: scrollDirection, + mangaId: manga.id!, mangaReaderPadding: mangaReaderPadding.value, mangaReaderMagnifierSize: mangaReaderMagnifierSize.value, onNext: onNext, @@ -448,6 +449,7 @@ class ReaderView extends HookWidget { super.key, required this.toggleVisibility, required this.scrollDirection, + required this.mangaId, required this.mangaReaderPadding, required this.mangaReaderMagnifierSize, required this.onNext, @@ -461,6 +463,7 @@ class ReaderView extends HookWidget { final VoidCallback toggleVisibility; final Axis scrollDirection; + final int mangaId; final double mangaReaderPadding; final double mangaReaderMagnifierSize; final VoidCallback onNext; @@ -482,19 +485,19 @@ class ReaderView extends HookWidget { ); nextChapter() => prevNextChapterPair?.first != null ? ReaderRoute( - mangaId: prevNextChapterPair!.first!.mangaId!, + mangaId: mangaId, chapterIndex: prevNextChapterPair!.first!.index!, transVertical: scrollDirection != Axis.vertical, ).pushReplacement(context) : null; prevChapter() => prevNextChapterPair?.second != null ? ReaderRoute( - mangaId: prevNextChapterPair!.second!.mangaId!, + mangaId: mangaId, chapterIndex: prevNextChapterPair!.second!.index!, toPrev: true, transVertical: scrollDirection != Axis.vertical, ).pushReplacement(context) - : null; + : MangaRoute(mangaId: mangaId).pushReplacement(context); return Stack( children: [ GestureDetector(