copyWith method

VideoPlayerValue copyWith({
  1. Duration? duration,
  2. Size? size,
  3. Duration? position,
  4. Caption? caption,
  5. Duration? captionOffset,
  6. List<DurationRange>? buffered,
  7. bool? isInitialized,
  8. bool? isPlaying,
  9. bool? isLooping,
  10. bool? isBuffering,
  11. double? volume,
  12. double? playbackSpeed,
  13. int? rotationCorrection,
  14. String? errorDescription = _defaultErrorDescription,
  15. bool? isCompleted,
})

Returns a new instance that has the same values as this current instance, except for any overrides passed in as arguments to copyWith.

Implementation

VideoPlayerValue copyWith({
  Duration? duration,
  Size? size,
  Duration? position,
  Caption? caption,
  Duration? captionOffset,
  List<DurationRange>? buffered,
  bool? isInitialized,
  bool? isPlaying,
  bool? isLooping,
  bool? isBuffering,
  double? volume,
  double? playbackSpeed,
  int? rotationCorrection,
  String? errorDescription = _defaultErrorDescription,
  bool? isCompleted,
}) {
  return VideoPlayerValue(
    duration: duration ?? this.duration,
    size: size ?? this.size,
    position: position ?? this.position,
    caption: caption ?? this.caption,
    captionOffset: captionOffset ?? this.captionOffset,
    buffered: buffered ?? this.buffered,
    isInitialized: isInitialized ?? this.isInitialized,
    isPlaying: isPlaying ?? this.isPlaying,
    isLooping: isLooping ?? this.isLooping,
    isBuffering: isBuffering ?? this.isBuffering,
    volume: volume ?? this.volume,
    playbackSpeed: playbackSpeed ?? this.playbackSpeed,
    rotationCorrection: rotationCorrection ?? this.rotationCorrection,
    errorDescription: errorDescription != _defaultErrorDescription
        ? errorDescription
        : this.errorDescription,
    isCompleted: isCompleted ?? this.isCompleted,
  );
}