diff --git a/lib/foundation/local.dart b/lib/foundation/local.dart index 988311f..ee8284e 100644 --- a/lib/foundation/local.dart +++ b/lib/foundation/local.dart @@ -7,6 +7,7 @@ import 'package:venera/foundation/comic_source/comic_source.dart'; import 'package:venera/foundation/comic_type.dart'; import 'package:venera/network/download.dart'; import 'package:venera/pages/reader/reader.dart'; +import 'package:venera/utils/ext.dart'; import 'package:venera/utils/io.dart'; import 'app.dart'; @@ -62,7 +63,7 @@ class LocalComic with HistoryMixin implements Comic { subtitle = row[2] as String, tags = List.from(jsonDecode(row[3] as String)), directory = row[4] as String, - chapters = Map.from(jsonDecode(row[5] as String)), + chapters = MapOrNull.from(jsonDecode(row[5] as String)), cover = row[6] as String, comicType = ComicType(row[7] as int), downloadedChapters = List.from(jsonDecode(row[8] as String)), diff --git a/lib/pages/search_result_page.dart b/lib/pages/search_result_page.dart index ca558dc..e3b4418 100644 --- a/lib/pages/search_result_page.dart +++ b/lib/pages/search_result_page.dart @@ -394,7 +394,7 @@ class _SearchSettingsDialogState extends State<_SearchSettingsDialog> { }, ); }).toList(), - ), + ).fixWidth(double.infinity).paddingHorizontal(16), buildSearchOptions(), const SizedBox(height: 24), FilledButton( @@ -404,7 +404,7 @@ class _SearchSettingsDialogState extends State<_SearchSettingsDialog> { }, ), ], - ).fixWidth(400), + ).fixWidth(double.infinity), ); } diff --git a/lib/utils/ext.dart b/lib/utils/ext.dart index 75edc98..eff2b8d 100644 --- a/lib/utils/ext.dart +++ b/lib/utils/ext.dart @@ -85,8 +85,14 @@ extension StringExt on String{ bool get isNum => double.tryParse(this) != null; } -class ListOrNull{ +abstract class ListOrNull{ static List? from(Iterable? i){ return i == null ? null : List.from(i); } +} + +abstract class MapOrNull{ + static Map? from(Map? i){ + return i == null ? null : Map.from(i); + } } \ No newline at end of file