copyWith method

StoryModel copyWith({
  1. String? id,
  2. List<StoryElement>? elements,
  3. String? colorFiler,
  4. List<Color>? paletteColors,
})

Implementation

StoryModel copyWith({
  String? id,
  List<StoryElement>? elements,
  String? colorFiler,
  List<Color>? paletteColors,
}) {
  return StoryModel(
    id: id ?? this.id,
  )
    ..elements = elements ?? _elements
    ..colorFilter = colorFiler ?? _colorFiler
    ..isVideoIncluded = isVideoIncluded
    ..videoDuration = _videoDuration
    ..paletteColors = paletteColors ?? _paletteColors;
}