33 lines
759 B
Dart
33 lines
759 B
Dart
import 'dart:developer' as developer;
|
|
|
|
class Video {
|
|
String id;
|
|
String title;
|
|
String thumbnail;
|
|
String description;
|
|
String duration;
|
|
String uploader;
|
|
String uploadDate;
|
|
|
|
Video({
|
|
required this.id,
|
|
required this.title,
|
|
this.thumbnail = '',
|
|
this.description = '',
|
|
this.duration = '0:00',
|
|
required this.uploader,
|
|
required this.uploadDate,
|
|
});
|
|
|
|
factory Video.fromJson(Map<String, dynamic> json) {
|
|
return Video(
|
|
id: json['id'],
|
|
title: json['title'],
|
|
thumbnail: json['thumbnails']![0]['url'],
|
|
description: json['description'] ?? '',
|
|
duration: json['duration_string'] ?? '0:00',
|
|
uploader: json['uploader'] ?? '',
|
|
uploadDate: json['upload_date'] ?? '');
|
|
}
|
|
}
|