copyWith method

StoryDocument copyWith({
  1. StoryMedia? media,
  2. MediaPlacement? placement,
  3. StoryBackground? background,
  4. String? filterId,
  5. List<StoryOverlay>? overlays,
  6. List<DrawingStroke>? strokes,
  7. TrimRange? trim,
  8. double? originalVolume,
  9. MusicSelection? music,
  10. bool clearFilter = false,
  11. bool clearTrim = false,
  12. bool clearMusic = false,
})

Returns a copy with the given values replaced. Use clearFilter, clearTrim and clearMusic to set those to null.

Implementation

StoryDocument copyWith({
  StoryMedia? media,
  MediaPlacement? placement,
  StoryBackground? background,
  String? filterId,
  List<StoryOverlay>? overlays,
  List<DrawingStroke>? strokes,
  TrimRange? trim,
  double? originalVolume,
  MusicSelection? music,
  bool clearFilter = false,
  bool clearTrim = false,
  bool clearMusic = false,
}) => StoryDocument(
  media: media ?? this.media,
  placement: placement ?? this.placement,
  background: background ?? this.background,
  filterId: clearFilter ? null : (filterId ?? this.filterId),
  overlays: overlays ?? this.overlays,
  strokes: strokes ?? this.strokes,
  trim: clearTrim ? null : (trim ?? this.trim),
  originalVolume: originalVolume ?? this.originalVolume,
  music: clearMusic ? null : (music ?? this.music),
);