Create empty() factory for word search results
All checks were successful
Build database / evals (push) Successful in 35m56s
All checks were successful
Build database / evals (push) Successful in 35m56s
This commit is contained in:
@@ -81,6 +81,18 @@ class WordSearchResult {
|
||||
sources: WordSearchSources.fromJson(json['sources']),
|
||||
);
|
||||
|
||||
factory WordSearchResult.empty() => WordSearchResult(
|
||||
score: 0,
|
||||
entryId: 0,
|
||||
isCommon: false,
|
||||
japanese: [],
|
||||
kanjiInfo: {},
|
||||
readingInfo: {},
|
||||
senses: [],
|
||||
jlptLevel: JlptLevel.none,
|
||||
sources: WordSearchSources.empty(),
|
||||
);
|
||||
|
||||
String _formatJapaneseWord(WordSearchRuby word) =>
|
||||
word.furigana == null ? word.base : '${word.base} (${word.furigana})';
|
||||
|
||||
|
||||
@@ -9,6 +9,8 @@ class WordSearchSources {
|
||||
|
||||
const WordSearchSources({this.jmdict = true, this.jmnedict = false});
|
||||
|
||||
factory WordSearchSources.empty() => const WordSearchSources();
|
||||
|
||||
Map<String, Object?> get sqlValue => {'jmdict': jmdict, 'jmnedict': jmnedict};
|
||||
|
||||
Map<String, dynamic> toJson() => {'jmdict': jmdict, 'jmnedict': jmnedict};
|
||||
|
||||
Reference in New Issue
Block a user