Add dynamic category part.

This commit is contained in:
2025-04-05 20:11:05 +08:00
parent 554b9f2a77
commit c096f5a2d8
3 changed files with 59 additions and 6 deletions

View File

@@ -34,6 +34,9 @@ class _CategoryComicsPageState extends State<CategoryComicsPage> {
void findData() {
for (final source in ComicSource.all()) {
if (source.categoryData?.key == widget.categoryKey) {
if (source.categoryComicsData == null) {
throw "The comic source ${source.name} does not support category comics";
}
data = source.categoryComicsData!;
options = data.options.where((element) {
if (element.notShowWhen.contains(widget.category)) {