MediaInfo.fromMap constructor
Implementation
factory MediaInfo.fromMap(
Map<dynamic, dynamic> map, {
bool updateArt = true,
MediaInfo? oldMedia,
}) {
assert(
updateArt || oldMedia != null,
'oldMedia must not be null if updateArt is false',
);
return MediaInfo(
title: map['title'] as String?,
artist: map['artist'] as String?,
album: map['album'] as String?,
queueIndex: map['queueIndex'] as int?,
packageName: map['packageName'] as String?,
albumArt: updateArt ? map['albumArt'] as Uint8List? : oldMedia?.albumArt,
isPlaying: map['isPlaying'] as bool? ?? false,
state: PlaybackState.fromString(map['state'] as String?),
);
}