diff --git a/lib/pages/search_result_page.dart b/lib/pages/search_result_page.dart index 19d2105..1d67e5f 100644 --- a/lib/pages/search_result_page.dart +++ b/lib/pages/search_result_page.dart @@ -42,7 +42,7 @@ class _SearchResultPageState extends State { void search([String? text]) { if (text != null) { - if(suggestionsController.entry != null) { + if (suggestionsController.entry != null) { suggestionsController.remove(); } setState(() { @@ -135,20 +135,24 @@ class _SearchResultPageState extends State { onChanged: onChanged, action: buildAction(), ), - loadPage: source!.searchPageData!.loadPage == null ? null : (i) { - return source.searchPageData!.loadPage!( - text, - i, - options, - ); - }, - loadNext: source.searchPageData!.loadNext == null ? null : (i) { - return source.searchPageData!.loadNext!( - text, - i, - options, - ); - }, + loadPage: source!.searchPageData!.loadPage == null + ? null + : (i) { + return source.searchPageData!.loadPage!( + text, + i, + options, + ); + }, + loadNext: source.searchPageData!.loadNext == null + ? null + : (i) { + return source.searchPageData!.loadNext!( + text, + i, + options, + ); + }, ); } @@ -424,6 +428,11 @@ class _SearchSettingsDialogState extends State<_SearchSettingsDialog> { setState(() { searchTarget = e.key; options.clear(); + final searchOptions = ComicSource.find(searchTarget)! + .searchPageData! + .searchOptions ?? + []; + options = searchOptions.map((e) => e.defaultValue).toList(); onChanged(); }); },