import 'package:PiliPlus/models_new/pgc/pgc_timeline/episode.dart'; class TimelineResult { String? date; int? dateTs; int? dayOfWeek; List? episodes; int? isToday; TimelineResult({ this.date, this.dateTs, this.dayOfWeek, this.episodes, this.isToday, }); factory TimelineResult.fromJson(Map json) => TimelineResult( date: json['date'] as String?, dateTs: json['date_ts'] as int?, dayOfWeek: json['day_of_week'] as int?, episodes: (json['episodes'] as List?) ?.map((e) => Episode.fromJson(e as Map)) .toList(), isToday: json['is_today'] as int?, ); void addAll(TimelineResult other) { if (dateTs == other.dateTs) { if (other.episodes case final list?) { (episodes ??= []).addAll(list); } } } }