VideoWithCommentsList.fromMap constructor Null safety
Implementation
factory VideoWithCommentsList.fromMap(Map<String, dynamic> map) {
var total = map['total'];
if (total is int) {
total = '$total';
}
return VideoWithCommentsList(
total: total,
paginated: map['paginated'] ?? false,
videos: List<VideoWithComments>.from(
map['items']?.map(
(x) => VideoWithComments.fromMap(x),
) ??
[],
),
);
}