LinkPreviewOptions class abstract

Describes the options used for link preview generation.

Available extensions
Annotations
  • @freezed

Constructors

LinkPreviewOptions({@JsonKey.new(name: 'is_disabled') bool? isDisabled, @JsonKey.new(name: 'url') String? url, @JsonKey.new(name: 'prefer_small_media') bool? preferSmallMedia, @JsonKey.new(name: 'prefer_large_media') bool? preferLargeMedia, @JsonKey.new(name: 'show_above_text') bool? showAboveText})
Constructs an instance of LinkPreviewOptions.
const
factory
LinkPreviewOptions.fromJson(Map<String, dynamic> json)
Creates an instance of LinkPreviewOptions from JSON data.
factory

Properties

copyWith → $LinkPreviewOptionsCopyWith<LinkPreviewOptions>
Create a copy of LinkPreviewOptions with the given fields replaced by the non-null parameter values.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
isDisabled → bool?
Optional. True, if the link preview is disabled
no setterinherited
preferLargeMedia → bool?
Optional. True, if the media in the link preview is supposed to be enlarged; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
no setterinherited
preferSmallMedia → bool?
Optional. True, if the media in the link preview is supposed to be shrunk; ignored if the URL isn't explicitly specified or media size change isn't supported for the preview
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showAboveText → bool?
Optional. True, if the link preview must be shown above the message text; otherwise, the link preview will be shown below the message text
no setterinherited
url → String?
Optional. URL to use for the link preview. If empty, then the first URL found in the message text will be used
no setterinherited

Methods

map<TResult extends Object?>(TResult $default(_LinkPreviewOptions value)) → TResult

Available on LinkPreviewOptions, provided by the LinkPreviewOptionsPatterns extension

A switch-like method, using callbacks.
mapOrNull<TResult extends Object?>(TResult? $default(_LinkPreviewOptions value)?) → TResult?

Available on LinkPreviewOptions, provided by the LinkPreviewOptionsPatterns extension

A variant of map that fallback to returning null.
maybeMap<TResult extends Object?>(TResult $default(_LinkPreviewOptions value)?, {required TResult orElse()}) → TResult

Available on LinkPreviewOptions, provided by the LinkPreviewOptionsPatterns extension

A variant of map that fallback to returning orElse.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Serializes this LinkPreviewOptions to a JSON map.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Properties

disabled → LinkPreviewOptions
Returns a LinkPreviewOptions instance with link preview disabled.
no setter