Line data Source code
1 : import 'package:flutter_chrome_cast/common/image.dart';
2 : import 'package:flutter_chrome_cast/enums/media_metadata_type.dart';
3 :
4 : /// Holds metadata type and images for a media item.
5 : class GoogleCastMediaMetadata {
6 : /// The type of media metadata.
7 : final GoogleCastMediaMetadataType metadataType;
8 :
9 : /// List of images associated with the media.
10 : final List<GoogleCastImage>? images;
11 :
12 : /// Creates a new [GoogleCastMediaMetadata] instance.
13 0 : GoogleCastMediaMetadata({
14 : required this.metadataType,
15 : this.images,
16 : });
17 :
18 : /// Converts the object to a map for serialization.
19 0 : Map<String, dynamic> toMap() {
20 0 : return {
21 0 : 'metadataType': metadataType.value,
22 0 : 'images': images?.map((x) => x.toMap()).toList(),
23 : };
24 : }
25 : }
|