VideoWithCommentsList.fromMap constructor Null safety

VideoWithCommentsList.fromMap(
  1. Map<String, dynamic> map
)

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),
          ) ??
          [],
    ),
  );
}