mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
Default to displaying the last read chapter group. (#264)
This commit is contained in:
@@ -186,12 +186,17 @@ class _GroupedComicChaptersState extends State<_GroupedComicChapters>
|
|||||||
|
|
||||||
late TabController tabController;
|
late TabController tabController;
|
||||||
|
|
||||||
int index = 0;
|
late int index;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
super.initState();
|
super.initState();
|
||||||
history = widget.history;
|
history = widget.history;
|
||||||
|
if (history?.group != null) {
|
||||||
|
index = history!.group! - 1;
|
||||||
|
} else {
|
||||||
|
index = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -199,6 +204,7 @@ class _GroupedComicChaptersState extends State<_GroupedComicChapters>
|
|||||||
state = context.findAncestorStateOfType<_ComicPageState>()!;
|
state = context.findAncestorStateOfType<_ComicPageState>()!;
|
||||||
chapters = state.comic.chapters!;
|
chapters = state.comic.chapters!;
|
||||||
tabController = TabController(
|
tabController = TabController(
|
||||||
|
initialIndex: index,
|
||||||
length: chapters.ids.length,
|
length: chapters.ids.length,
|
||||||
vsync: this,
|
vsync: this,
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user