PlaybackState.fromMap constructor
PlaybackState.fromMap(
- Map map
Creates a PlaybackState from a map
Implementation
factory PlaybackState.fromMap(Map<dynamic, dynamic> map) {
return PlaybackState(
processingState: _mapToProcessingState(
map['state'] as String? ?? 'stopped',
),
playing: map['state'] == 'playing',
title: map['title'] as String? ?? 'Unknown',
position: map['position'] as int? ?? 0,
duration: map['duration'] as int? ?? 0,
timestamp: map['timestamp'] as int? ?? 0,
speed: map['speed'] as double? ?? 1.0,
volume: map['volume'] as double? ?? 1.0,
artist: map['artist'] as String?,
album: map['album'] as String?,
url: map['url'] as String?,
artUri: map['artUri'] as String?,
genre: map['genre'] as String?,
trackNumber: map['trackNumber'] as int?,
trackCount: map['trackCount'] as int?,
year: map['year'] as int?,
);
}