class MainPageContentType {
  final int id;
  final String title;
  final String image;
  final String link;
  bool marked;
  bool isViewed;
  final List<String> subtitles;
  final int? duration;
  final String? description;

  MainPageContentType({
    required this.id,
    required this.title,
    required this.image,
    required this.link,
    required this.marked,
    required this.isViewed,
    required this.subtitles,
    this.duration,
    this.description,
  });

  factory MainPageContentType.fromJson(Map<String, dynamic> json) =>
      MainPageContentType(
        id: json['id'],
        title: json['title'],
        image: json['image'],
        link: json['link'],
        marked: json['marked'],
        isViewed: json['isViewed'] ?? false,
        subtitles: List<String>.from(json['subtitles']),
        duration: json['duration'],
        description: json['description'],
      );
}
