copyWith method
PlaybackState
copyWith({
- AudioPlaybackState? state,
- AudioTrack? currentTrack,
- Duration? position,
- Duration? duration,
- Duration? bufferedPosition,
- double? volume,
- double? speed,
- ShuffleMode? shuffleMode,
- RepeatMode? repeatMode,
- bool? isBuffering,
- AudioLoadingState? loadingState,
- AudioCacheState? cacheState,
- int? currentIndex,
- String? errorMessage,
- Map<
String, dynamic> ? extra,
Creates a copy of this state with the specified properties changed.
Implementation
PlaybackState copyWith({
AudioPlaybackState? state,
AudioTrack? currentTrack,
Duration? position,
Duration? duration,
Duration? bufferedPosition,
double? volume,
double? speed,
ShuffleMode? shuffleMode,
RepeatMode? repeatMode,
bool? isBuffering,
AudioLoadingState? loadingState,
AudioCacheState? cacheState,
int? currentIndex,
String? errorMessage,
Map<String, dynamic>? extra,
}) {
return PlaybackState(
state: state ?? this.state,
currentTrack: currentTrack ?? this.currentTrack,
position: position ?? this.position,
duration: duration ?? this.duration,
bufferedPosition: bufferedPosition ?? this.bufferedPosition,
volume: volume ?? this.volume,
speed: speed ?? this.speed,
shuffleMode: shuffleMode ?? this.shuffleMode,
repeatMode: repeatMode ?? this.repeatMode,
isBuffering: isBuffering ?? this.isBuffering,
loadingState: loadingState ?? this.loadingState,
cacheState: cacheState ?? this.cacheState,
currentIndex: currentIndex ?? this.currentIndex,
errorMessage: errorMessage ?? this.errorMessage,
extra: extra ?? this.extra,
);
}