copyWith method

WebPage copyWith({
  1. String? url,
  2. String? displayUrl,
  3. String? type,
  4. String? siteName,
  5. String? title,
  6. FormattedText? description,
  7. Photo? photo()?,
  8. String? embedUrl,
  9. String? embedType,
  10. int? embedWidth,
  11. int? embedHeight,
  12. int? duration,
  13. String? author,
  14. bool? hasLargeMedia,
  15. bool? showLargeMedia,
  16. bool? skipConfirmation,
  17. bool? showAboveText,
  18. Animation? animation()?,
  19. Audio? audio()?,
  20. Document? document()?,
  21. Sticker? sticker()?,
  22. Video? video()?,
  23. VideoNote? videoNote()?,
  24. VoiceNote? voiceNote()?,
  25. int? storySenderChatId,
  26. int? storyId,
  27. int? instantViewVersion,
  28. dynamic extra,
  29. int? clientId,
})

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

WebPage copyWith({
  String? url,
  String? displayUrl,
  String? type,
  String? siteName,
  String? title,
  FormattedText? description,
  Photo? Function()? photo,
  String? embedUrl,
  String? embedType,
  int? embedWidth,
  int? embedHeight,
  int? duration,
  String? author,
  bool? hasLargeMedia,
  bool? showLargeMedia,
  bool? skipConfirmation,
  bool? showAboveText,
  Animation? Function()? animation,
  Audio? Function()? audio,
  Document? Function()? document,
  Sticker? Function()? sticker,
  Video? Function()? video,
  VideoNote? Function()? videoNote,
  VoiceNote? Function()? voiceNote,
  int? storySenderChatId,
  int? storyId,
  int? instantViewVersion,
  dynamic extra,
  int? clientId,
}) =>
    WebPage(
      url: url ?? this.url,
      displayUrl: displayUrl ?? this.displayUrl,
      type: type ?? this.type,
      siteName: siteName ?? this.siteName,
      title: title ?? this.title,
      description: description ?? this.description,
      photo: photo != null ? photo() : this.photo,
      embedUrl: embedUrl ?? this.embedUrl,
      embedType: embedType ?? this.embedType,
      embedWidth: embedWidth ?? this.embedWidth,
      embedHeight: embedHeight ?? this.embedHeight,
      duration: duration ?? this.duration,
      author: author ?? this.author,
      hasLargeMedia: hasLargeMedia ?? this.hasLargeMedia,
      showLargeMedia: showLargeMedia ?? this.showLargeMedia,
      skipConfirmation: skipConfirmation ?? this.skipConfirmation,
      showAboveText: showAboveText ?? this.showAboveText,
      animation: animation != null ? animation() : this.animation,
      audio: audio != null ? audio() : this.audio,
      document: document != null ? document() : this.document,
      sticker: sticker != null ? sticker() : this.sticker,
      video: video != null ? video() : this.video,
      videoNote: videoNote != null ? videoNote() : this.videoNote,
      voiceNote: voiceNote != null ? voiceNote() : this.voiceNote,
      storySenderChatId: storySenderChatId ?? this.storySenderChatId,
      storyId: storyId ?? this.storyId,
      instantViewVersion: instantViewVersion ?? this.instantViewVersion,
      extra: extra ?? this.extra,
      clientId: clientId ?? this.clientId,
    );