PlaybackStateMessage.fromMap constructor
PlaybackStateMessage.fromMap(
- Map<String, dynamic> map
)
Implementation
factory PlaybackStateMessage.fromMap(Map<String, dynamic> map) =>
PlaybackStateMessage(
processingState:
AudioProcessingStateMessage.values[map['processingState'] as int],
playing: map['playing'] as bool,
controls: const [],
androidCompactActionIndices: null,
systemActions: (map['systemActions'] as List)
.map((dynamic action) => MediaActionMessage.values[action as int])
.toSet(),
updatePosition: Duration(microseconds: map['updatePosition'] as int),
bufferedPosition:
Duration(microseconds: map['bufferedPosition'] as int),
speed: map['speed'] as double,
updateTime:
DateTime.fromMillisecondsSinceEpoch(map['updateTime'] as int),
errorCode: map['errorCode'] as int?,
errorMessage: map['errorMessage'] as String?,
repeatMode:
AudioServiceRepeatModeMessage.values[map['repeatMode'] as int],
shuffleMode:
AudioServiceShuffleModeMessage.values[map['shuffleMode'] as int],
captioningEnabled: map['captioningEnabled'] as bool,
queueIndex: map['queueIndex'] as int?,
);