Line data Source code
1 : import 'package:flutter_chrome_cast/lib.dart';
2 :
3 : /// iOS-specific implementation of photo media metadata.
4 : class GooglCastPhotoMediaMetadataIOS extends GoogleCastPhotoMediaMetadata {
5 : /// Creates an iOS photo media metadata instance.
6 0 : GooglCastPhotoMediaMetadataIOS({
7 : super.artist,
8 : super.creationDateTime,
9 : super.height,
10 : super.latitude,
11 : super.location,
12 : super.longitude,
13 : super.title,
14 : super.width,
15 : });
16 :
17 : /// Creates a photo media metadata instance from a map.
18 0 : factory GooglCastPhotoMediaMetadataIOS.fromMap(Map<String, dynamic> map) {
19 0 : return GooglCastPhotoMediaMetadataIOS(
20 0 : title: map['title'],
21 0 : artist: map['albumArtist'],
22 0 : location: map['locationName'],
23 0 : latitude: map['locationLatitude']?.toDouble(),
24 0 : longitude: map['locationLongitude']?.toDouble(),
25 0 : width: map['width']?.toInt(),
26 0 : height: map['height']?.toInt(),
27 0 : creationDateTime: map['creationDate'] != null
28 0 : ? DateTime.fromMillisecondsSinceEpoch(map['creationDate'] ?? 0)
29 : : null,
30 : );
31 : }
32 : }
|