mirror of
https://github.com/gabehf/Fladder.git
synced 2026-03-07 21:48:14 -08:00
feature: Improve episode status indicators (#229)
Co-authored-by: PartyDonut <PartyDonut@users.noreply.github.com>
This commit is contained in:
parent
a34f8fe2f4
commit
492857a8ad
3 changed files with 37 additions and 13 deletions
|
|
@ -20,7 +20,25 @@ import 'package:fladder/util/string_extensions.dart';
|
|||
|
||||
part 'episode_model.mapper.dart';
|
||||
|
||||
enum EpisodeStatus { available, unaired, missing }
|
||||
enum EpisodeStatus {
|
||||
available,
|
||||
unaired,
|
||||
missing;
|
||||
|
||||
const EpisodeStatus();
|
||||
|
||||
Color get color => switch (this) {
|
||||
EpisodeStatus.available => Colors.lightGreenAccent,
|
||||
EpisodeStatus.unaired => Colors.indigoAccent,
|
||||
EpisodeStatus.missing => Colors.redAccent,
|
||||
};
|
||||
|
||||
String label(BuildContext context) => switch (this) {
|
||||
EpisodeStatus.available => context.localized.episodeAvailable,
|
||||
EpisodeStatus.unaired => context.localized.episodeUnaired,
|
||||
EpisodeStatus.missing => context.localized.episodeMissing,
|
||||
};
|
||||
}
|
||||
|
||||
@MappableClass()
|
||||
class EpisodeModel extends ItemStreamModel with EpisodeModelMappable {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue