Initial commit
This commit is contained in:
50
lib/src/data/anime.dart
Normal file
50
lib/src/data/anime.dart
Normal file
@@ -0,0 +1,50 @@
|
||||
/// The watch state of an anime
|
||||
enum AnimeTrackingState {
|
||||
watching,
|
||||
completed,
|
||||
planToWatch,
|
||||
dropped,
|
||||
}
|
||||
|
||||
/// Data about a tracked anime
|
||||
class AnimeTrackingData {
|
||||
const AnimeTrackingData(
|
||||
this.id,
|
||||
this.state,
|
||||
this.title,
|
||||
this.episodesWatched,
|
||||
this.episodesTotal,
|
||||
this.thumbnailUrl,
|
||||
);
|
||||
|
||||
/// The ID of the anime
|
||||
final String id;
|
||||
|
||||
/// The state of the anime
|
||||
final AnimeTrackingState state;
|
||||
|
||||
/// The title of the anime
|
||||
final String title;
|
||||
|
||||
/// Episodes in total.
|
||||
final int? episodesTotal;
|
||||
|
||||
/// Episodes watched.
|
||||
final int episodesWatched;
|
||||
|
||||
/// URL to the thumbnail/cover art for the anime.
|
||||
final String thumbnailUrl;
|
||||
|
||||
AnimeTrackingData copyWith(
|
||||
int episodesWatched,
|
||||
) {
|
||||
return AnimeTrackingData(
|
||||
id,
|
||||
state,
|
||||
title,
|
||||
episodesWatched,
|
||||
episodesTotal,
|
||||
thumbnailUrl,
|
||||
);
|
||||
}
|
||||
}
|
||||
25
lib/src/data/search_result.dart
Normal file
25
lib/src/data/search_result.dart
Normal file
@@ -0,0 +1,25 @@
|
||||
class AnimeSearchResult {
|
||||
const AnimeSearchResult(
|
||||
this.title,
|
||||
this.id,
|
||||
this.episodesTotal,
|
||||
this.thumbnailUrl,
|
||||
this.description,
|
||||
);
|
||||
|
||||
/// The title of the anime.
|
||||
final String title;
|
||||
|
||||
/// The id of the anime.
|
||||
final String id;
|
||||
|
||||
/// The URL to a thumbnail image.
|
||||
final String thumbnailUrl;
|
||||
|
||||
/// The amount of total episodes. If null, it means that there is not total amount
|
||||
/// of episodes set.
|
||||
final int? episodesTotal;
|
||||
|
||||
/// The description of the anime
|
||||
final String description;
|
||||
}
|
||||
Reference in New Issue
Block a user