fromJson static method
Implementation
static ClipsData? fromJson(Map<String, dynamic>? json) {
if (json == null) return null;
final duration = json['duration'];
return ClipsData(
id: json['id'],
url: json['url'],
embedUrl: json['embed_url'],
broadcasterId: json['broadcaster_id'],
broadcasterName: json['broadcaster_name'],
creatorId: json['creator_id'],
creatorName: json['creator_name'],
videoId: json['video_id'],
gameId: json['game_id'],
language: json['language'],
title: json['title'],
viewCount: json['view_count'],
createdAt: json['created_at'],
thumbnailUrl: json['thumbnail_url'],
duration: duration is double ? duration : (duration as int?)?.toDouble(),
);
}