copyWith method
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,
);
}