create static method

LinkPreview create({
  1. bool schemeUtilsIsSetDefaultData = false,
  2. String special_type = "linkPreview",
  3. String special_return_type = "linkPreview",
  4. String? url,
  5. String? display_url,
  6. String? site_name,
  7. String? title,
  8. FormattedText? description,
  9. String? author,
  10. LinkPreviewType? type,
  11. bool? has_large_media,
  12. bool? show_large_media,
  13. bool? show_media_above_description,
  14. bool? skip_confirmation,
  15. bool? show_above_text,
  16. num? instant_view_version,
})
override

Generate By General Universe Script Dont edit by hand or anything manual

Implementation

static LinkPreview create({
  bool schemeUtilsIsSetDefaultData = false,
  String special_type = "linkPreview",
  String special_return_type = "linkPreview",
  String? url,
  String? display_url,
  String? site_name,
  String? title,
  FormattedText? description,
  String? author,
  LinkPreviewType? type,
  bool? has_large_media,
  bool? show_large_media,
  bool? show_media_above_description,
  bool? skip_confirmation,
  bool? show_above_text,
  num? instant_view_version,
}) {
  // LinkPreview linkPreview = LinkPreview({
  final Map linkPreview_data_create_json = {
    "@type": special_type,
    "@return_type": special_return_type,
    "url": url,
    "display_url": display_url,
    "site_name": site_name,
    "title": title,
    "description": (description != null) ? description.toJson() : null,
    "author": author,
    "type": (type != null) ? type.toJson() : null,
    "has_large_media": has_large_media,
    "show_large_media": show_large_media,
    "show_media_above_description": show_media_above_description,
    "skip_confirmation": skip_confirmation,
    "show_above_text": show_above_text,
    "instant_view_version": instant_view_version,
  };

  linkPreview_data_create_json.removeWhere((key, value) => value == null);

  if (schemeUtilsIsSetDefaultData) {
    defaultData.forEach((key, value) {
      if (linkPreview_data_create_json.containsKey(key) == false) {
        linkPreview_data_create_json[key] = value;
      }
    });
  }
  return LinkPreview(linkPreview_data_create_json);
}