GoogleCastGenericMediaMetadataIOS.fromMap constructor

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

Creates a generic media metadata instance from a map.

Implementation

factory GoogleCastGenericMediaMetadataIOS.fromMap(Map<String, dynamic> map) {
  return GoogleCastGenericMediaMetadataIOS(
    title: map['title'] as String?,
    subtitle: map['subtitle'] as String?,
    images: map['images'] != null
        ? (map['images'] as List)
            .map((x) => GoogleCastImage.fromMap(Map<String, dynamic>.from(x)))
            .whereType<GoogleCastImage>()
            .toList()
        : null,
    releaseDate: map['releaseDate'] != null && map['releaseDate'] is int
        ? DateTime.fromMillisecondsSinceEpoch(map['releaseDate'])
        : null,
  );
}