new categorie page
better folder structure more info on video info page
This commit is contained in:
17
lib/types/actor.dart
Normal file
17
lib/types/actor.dart
Normal file
@ -0,0 +1,17 @@
|
||||
class Actor {
|
||||
int actorId;
|
||||
String name;
|
||||
String thumbnail;
|
||||
|
||||
Actor(this.actorId, this.name, this.thumbnail);
|
||||
|
||||
factory Actor.fromJson(dynamic json) {
|
||||
return Actor(json['ActorId'] as int, json['Name'] as String,
|
||||
json['Thumbnail'] as String);
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Actor{ActorId: $actorId, Name: $name, Thumbnail: $thumbnail}';
|
||||
}
|
||||
}
|
15
lib/types/tag.dart
Normal file
15
lib/types/tag.dart
Normal file
@ -0,0 +1,15 @@
|
||||
class Tag {
|
||||
String tagName;
|
||||
int tagId;
|
||||
|
||||
Tag(this.tagName, this.tagId);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Tag{tagName: $tagName, tagId: $tagId}';
|
||||
}
|
||||
|
||||
factory Tag.fromJson(dynamic json) {
|
||||
return Tag(json['TagName'] as String, json['TagId'] as int);
|
||||
}
|
||||
}
|
54
lib/types/video_data.dart
Normal file
54
lib/types/video_data.dart
Normal file
@ -0,0 +1,54 @@
|
||||
import 'tag.dart';
|
||||
import 'actor.dart';
|
||||
|
||||
class VideoData {
|
||||
String movieName;
|
||||
int movieId;
|
||||
String movieUrl;
|
||||
String poster;
|
||||
int likes;
|
||||
int quality;
|
||||
int length;
|
||||
|
||||
List<Tag> tags;
|
||||
List<Tag> suggestedTags;
|
||||
List<Actor> actors;
|
||||
|
||||
VideoData(
|
||||
this.movieName,
|
||||
this.movieId,
|
||||
this.movieUrl,
|
||||
this.poster,
|
||||
this.likes,
|
||||
this.quality,
|
||||
this.length,
|
||||
this.tags,
|
||||
this.suggestedTags,
|
||||
this.actors);
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'VideoData{movieName: $movieName, movieId: $movieId, movieUrl: $movieUrl, poster: $poster, likes: $likes, quality: $quality, length: $length, tags: $tags, suggestedTags: $suggestedTags, actors: $actors}';
|
||||
}
|
||||
|
||||
factory VideoData.fromJson(dynamic json) {
|
||||
return VideoData(
|
||||
json['MovieName'] as String,
|
||||
json['MovieId'] as int,
|
||||
json['MovieUrl'] as String,
|
||||
json['Poster'] as String,
|
||||
json['Likes'] as int,
|
||||
json['Quality'] as int,
|
||||
json['Length'] as int,
|
||||
((json['Tags'] ?? <dynamic>[]) as List<dynamic>)
|
||||
.map((e) => Tag.fromJson(e))
|
||||
.toList(growable: false),
|
||||
((json['SuggestedTag'] ?? []) as List<dynamic>)
|
||||
.map((e) => Tag.fromJson(e))
|
||||
.toList(growable: false),
|
||||
((json['Actors'] ?? []) as List<dynamic>)
|
||||
.map((e) => Actor.fromJson(e))
|
||||
.toList(growable: false),
|
||||
);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user