class MainPageContentType { final int id; final String title; final String image; final String link; bool marked; bool isViewed; final List subtitles; final int? duration; final String? description; final String? riskScore; 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, this.riskScore, }); factory MainPageContentType.fromJson(Map json) => MainPageContentType( id: json['id'], title: json['title'], image: json['image'], link: json['link'], marked: json['marked'], isViewed: json['isViewed'] ?? false, subtitles: List.from(json['subtitles']), duration: json['duration'], description: json['description'], riskScore: json['score'], ); }