SimplifiedPlaylist.fromMap constructor

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

Implementation

factory SimplifiedPlaylist.fromMap(Map<String, dynamic> map) {
  return SimplifiedPlaylist(
    id: map['id'] as String,
    name: map['name'],
    images: List<ImageModel>.from(
      (map['images']).map<ImageModel>(
        (x) => ImageModel.fromMap(x as Map<String, dynamic>),
      ),
    ),
    owner: UserModel.fromMap(map['owner'] as Map<String, dynamic>),
    public: map['public'] as bool? ?? true,
    snapshotId: map['snapshot_id'] as String,
    totalTracks: map['tracks']['total'] as int,
    collaborative: map['collaborative'] as bool,
    description: map['description'] as String?,
  );
}