This commit is contained in:
nyne
2024-10-18 16:13:58 +08:00
parent 700630e317
commit 5812cfc701
3 changed files with 11 additions and 4 deletions

View File

@@ -7,6 +7,7 @@ import 'package:venera/foundation/comic_source/comic_source.dart';
import 'package:venera/foundation/comic_type.dart'; import 'package:venera/foundation/comic_type.dart';
import 'package:venera/network/download.dart'; import 'package:venera/network/download.dart';
import 'package:venera/pages/reader/reader.dart'; import 'package:venera/pages/reader/reader.dart';
import 'package:venera/utils/ext.dart';
import 'package:venera/utils/io.dart'; import 'package:venera/utils/io.dart';
import 'app.dart'; import 'app.dart';
@@ -62,7 +63,7 @@ class LocalComic with HistoryMixin implements Comic {
subtitle = row[2] as String, subtitle = row[2] as String,
tags = List.from(jsonDecode(row[3] as String)), tags = List.from(jsonDecode(row[3] as String)),
directory = row[4] 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, cover = row[6] as String,
comicType = ComicType(row[7] as int), comicType = ComicType(row[7] as int),
downloadedChapters = List.from(jsonDecode(row[8] as String)), downloadedChapters = List.from(jsonDecode(row[8] as String)),

View File

@@ -394,7 +394,7 @@ class _SearchSettingsDialogState extends State<_SearchSettingsDialog> {
}, },
); );
}).toList(), }).toList(),
), ).fixWidth(double.infinity).paddingHorizontal(16),
buildSearchOptions(), buildSearchOptions(),
const SizedBox(height: 24), const SizedBox(height: 24),
FilledButton( FilledButton(
@@ -404,7 +404,7 @@ class _SearchSettingsDialogState extends State<_SearchSettingsDialog> {
}, },
), ),
], ],
).fixWidth(400), ).fixWidth(double.infinity),
); );
} }

View File

@@ -85,8 +85,14 @@ extension StringExt on String{
bool get isNum => double.tryParse(this) != null; bool get isNum => double.tryParse(this) != null;
} }
class ListOrNull{ abstract class ListOrNull{
static List<T>? from<T>(Iterable<dynamic>? i){ static List<T>? from<T>(Iterable<dynamic>? i){
return i == null ? null : List.from(i); return i == null ? null : List.from(i);
} }
}
abstract class MapOrNull{
static Map<K, V>? from<K, V>(Map<dynamic, dynamic>? i){
return i == null ? null : Map<K, V>.from(i);
}
} }