copyWith method

PlayerState copyWith({
  1. MediaInfo? currentMedia,
  2. Map<String, MediaInfo>? allPlayersMedia,
  3. bool? isPlayerctlInstalled,
  4. bool? hasActivePlayer,
  5. List<String>? availablePlayers,
  6. String? selectedPlayer,
  7. bool? isLoading,
  8. String? errorMessage,
  9. int? volume,
  10. String? shuffleStatus,
  11. String? loopStatus,
})

Copy with method for creating updated states

Implementation

PlayerState copyWith({
  MediaInfo? currentMedia,
  Map<String, MediaInfo>? allPlayersMedia,
  bool? isPlayerctlInstalled,
  bool? hasActivePlayer,
  List<String>? availablePlayers,
  String? selectedPlayer,
  bool? isLoading,
  String? errorMessage,
  int? volume,
  String? shuffleStatus,
  String? loopStatus,
}) {
  return PlayerState(
    currentMedia: currentMedia ?? this.currentMedia,
    allPlayersMedia: allPlayersMedia ?? this.allPlayersMedia,
    isPlayerctlInstalled: isPlayerctlInstalled ?? this.isPlayerctlInstalled,
    hasActivePlayer: hasActivePlayer ?? this.hasActivePlayer,
    availablePlayers: availablePlayers ?? this.availablePlayers,
    selectedPlayer: selectedPlayer ?? this.selectedPlayer,
    isLoading: isLoading ?? this.isLoading,
    errorMessage: errorMessage ?? this.errorMessage,
    volume: volume ?? this.volume,
    shuffleStatus: shuffleStatus ?? this.shuffleStatus,
    loopStatus: loopStatus ?? this.loopStatus,
  );
}