mirror of
https://github.com/venera-app/venera.git
synced 2025-09-27 07:47:24 +00:00
fix explore page translation
This commit is contained in:
@@ -27,7 +27,10 @@ class _ExplorePageState extends State<ExplorePage>
|
||||
@override
|
||||
void initState() {
|
||||
pages = List<String>.from(appdata.settings["explore_pages"]);
|
||||
var all = ComicSource.all().map((e) => e.explorePages).expand((e) => e.map((e) => e.title)).toList();
|
||||
var all = ComicSource.all()
|
||||
.map((e) => e.explorePages)
|
||||
.expand((e) => e.map((e) => e.title))
|
||||
.toList();
|
||||
pages = pages.where((e) => all.contains(e)).toList();
|
||||
controller = TabController(
|
||||
length: pages.length,
|
||||
@@ -52,7 +55,9 @@ class _ExplorePageState extends State<ExplorePage>
|
||||
);
|
||||
|
||||
Tab buildTab(String i) {
|
||||
return Tab(text: i.tl, key: Key(i));
|
||||
var comicSource = ComicSource.all()
|
||||
.firstWhere((e) => e.explorePages.any((e) => e.title == i));
|
||||
return Tab(text: i.ts(comicSource.key), key: Key(i));
|
||||
}
|
||||
|
||||
Widget buildBody(String i) => _SingleExplorePage(i, key: Key(i));
|
||||
@@ -104,9 +109,7 @@ class _ExplorePageState extends State<ExplorePage>
|
||||
removeTop: true,
|
||||
child: TabBarView(
|
||||
controller: controller,
|
||||
children: pages
|
||||
.map((e) => buildBody(e))
|
||||
.toList(),
|
||||
children: pages.map((e) => buildBody(e)).toList(),
|
||||
),
|
||||
),
|
||||
),
|
||||
|
Reference in New Issue
Block a user