Added starred to kanji state

This commit is contained in:
Oystein Kristoffer Tveit 2020-07-14 14:57:03 +02:00
parent c1a494fd9a
commit 920ad17e4c
2 changed files with 6 additions and 2 deletions

View File

@ -23,7 +23,7 @@ class KanjiBloc extends Bloc<KanjiEvent, KanjiState> {
try {
final _kanji = await fetchKanji(event.kanjiSearchString);
yield KanjiSearchFinished(_kanji);
yield KanjiSearchFinished(kanji: _kanji);
} on Exception {
yield KanjiSearchError('Something went wrong');
}

View File

@ -14,8 +14,12 @@ class KanjiSearchLoading extends KanjiState {
class KanjiSearchFinished extends KanjiState {
final KanjiResult kanji;
final bool starred;
KanjiSearchFinished(this.kanji);
KanjiSearchFinished({
this.kanji,
this.starred = false,
});
}
class KanjiSearchError extends KanjiState {