Skip to content

Commit

Permalink
Merge pull request #265 from Kamefrede/feature/qol-swipe-to-manga-page
Browse files Browse the repository at this point in the history
Support swiping from first chapter to manga page
  • Loading branch information
DattatreyaReddy authored Jan 16, 2024
2 parents c075fa5 + be6730f commit 0b2ab79
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,7 @@ class ReaderWrapper extends HookConsumerWidget {
toggleVisibility: () =>
visibility.value = !visibility.value,
scrollDirection: scrollDirection,
mangaId: manga.id!,
mangaReaderPadding: mangaReaderPadding.value,
mangaReaderMagnifierSize: mangaReaderMagnifierSize.value,
onNext: onNext,
Expand All @@ -447,6 +448,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,
Expand All @@ -460,6 +462,7 @@ class ReaderView extends HookWidget {

final VoidCallback toggleVisibility;
final Axis scrollDirection;
final int mangaId;
final double mangaReaderPadding;
final double mangaReaderMagnifierSize;
final VoidCallback onNext;
Expand All @@ -481,19 +484,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(
Expand Down

0 comments on commit 0b2ab79

Please sign in to comment.