copyWith method

PlaybackState copyWith({
  1. ProcessingState? processingState,
  2. bool? playing,
  3. String? title,
  4. int? position,
  5. int? duration,
  6. int? timestamp,
  7. double? speed,
  8. double? volume,
  9. String? artist,
  10. String? album,
  11. String? url,
  12. String? artUri,
  13. String? genre,
  14. int? trackNumber,
  15. int? trackCount,
  16. int? year,
})

Creates a copy of this PlaybackState with the given fields replaced

Implementation

PlaybackState copyWith({
  ProcessingState? processingState,
  bool? playing,
  String? title,
  int? position,
  int? duration,
  int? timestamp,
  double? speed,
  double? volume,
  String? artist,
  String? album,
  String? url,
  String? artUri,
  String? genre,
  int? trackNumber,
  int? trackCount,
  int? year,
}) {
  return PlaybackState(
    processingState: processingState ?? this.processingState,
    playing: playing ?? this.playing,
    title: title ?? this.title,
    position: position ?? this.position,
    duration: duration ?? this.duration,
    timestamp: timestamp ?? this.timestamp,
    speed: speed ?? this.speed,
    volume: volume ?? this.volume,
    artist: artist ?? this.artist,
    album: album ?? this.album,
    url: url ?? this.url,
    artUri: artUri ?? this.artUri,
    genre: genre ?? this.genre,
    trackNumber: trackNumber ?? this.trackNumber,
    trackCount: trackCount ?? this.trackCount,
    year: year ?? this.year,
  );
}