create static method
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,
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);
}