2020-07-13 15:18:17 +02:00
|
|
|
import 'package:unofficial_jisho_api/api.dart';
|
2020-07-09 20:06:48 +02:00
|
|
|
|
2020-07-13 15:18:17 +02:00
|
|
|
abstract class KanjiState {
|
|
|
|
const KanjiState();
|
|
|
|
}
|
2020-07-09 20:06:48 +02:00
|
|
|
|
2020-07-13 15:18:17 +02:00
|
|
|
class KanjiSearchInitial extends KanjiState {
|
2020-07-21 23:29:02 +02:00
|
|
|
const KanjiSearchInitial();
|
|
|
|
}
|
|
|
|
|
|
|
|
class KanjiSearchInput extends KanjiState {
|
|
|
|
final List<String> kanjiSuggestions;
|
|
|
|
const KanjiSearchInput(this.kanjiSuggestions);
|
2020-07-13 15:18:17 +02:00
|
|
|
}
|
2020-07-09 20:06:48 +02:00
|
|
|
|
2020-07-13 15:18:17 +02:00
|
|
|
class KanjiSearchLoading extends KanjiState {
|
2020-07-21 23:29:02 +02:00
|
|
|
const KanjiSearchLoading();
|
2020-07-13 15:18:17 +02:00
|
|
|
}
|
2020-07-09 20:06:48 +02:00
|
|
|
|
2020-07-13 15:18:17 +02:00
|
|
|
class KanjiSearchFinished extends KanjiState {
|
|
|
|
final KanjiResult kanji;
|
2020-07-14 14:57:03 +02:00
|
|
|
final bool starred;
|
2020-07-09 20:06:48 +02:00
|
|
|
|
2020-07-21 23:29:02 +02:00
|
|
|
const KanjiSearchFinished({
|
2020-07-14 14:57:03 +02:00
|
|
|
this.kanji,
|
|
|
|
this.starred = false,
|
|
|
|
});
|
2020-07-13 15:18:17 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
class KanjiSearchError extends KanjiState {
|
|
|
|
final String message;
|
|
|
|
|
2020-07-21 23:29:02 +02:00
|
|
|
const KanjiSearchError(this.message);
|
|
|
|
}
|