PlaybackState.fromJson constructor

PlaybackState.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory PlaybackState.fromJson(Map<String, dynamic> json) {
  return PlaybackState(
    item: json['item'] != null ? Track.fromJson(json['item']) : null,
    isPlaying: json['is_playing'] ?? false,
    progressMs: json['progress_ms'] ?? 0,
    repeatState: json['repeat_state'],
    shuffleState: json['shuffle_state'] ?? false,
    device: json['device'] != null ? Device.fromJson(json['device']) : null,
  );
}