copyWith method

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

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

Implementation

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