LinkPreviewBuilder class

A builder widget for creating link previews from a URL

Inheritance

Constructors

LinkPreviewBuilder.new({required String url, Key? key, LinkPreviewController? controller, MetadataProvider? provider, LinkPreviewStyle style = LinkPreviewStyle.card, int titleMaxLines = 2, int descriptionMaxLines = 3, bool showImage = true, bool showFavicon = true, LinkPreviewTapCallBack? onTap, bool handleNavigation = true, bool useCache = true, Duration? cacheDuration, bool forceRefresh = false, String? proxyUrl, Widget errorBuilder(BuildContext context, Object error)?, Widget loadingBuilder(BuildContext context)?, Widget emptyBuilder(BuildContext context)?})
Creates a LinkPreviewBuilder that extracts metadata from the given URL.
const

Properties

cacheDuration Duration?
Optional custom cache duration
final
controller LinkPreviewController?
Optional controller for managing the preview
final
descriptionMaxLines int
Maximum number of lines for the description
final
emptyBuilder Widget Function(BuildContext context)?
Builder for when no data is available
final
errorBuilder Widget Function(BuildContext context, Object error)?
Builder for handling errors
final
forceRefresh bool
Whether to force refresh the data
final
handleNavigation bool
Whether to handle navigation when tapped
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
loadingBuilder Widget Function(BuildContext context)?
Builder for customizing the loading state
final
onTap LinkPreviewTapCallBack?
Callback when the preview is tapped
final
provider MetadataProvider?
Optional metadata provider
final
proxyUrl String?
Optional CORS proxy URL for web platform
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showFavicon bool
Whether to show the favicon in the preview
final
showImage bool
Whether to show the image in the preview
final
style LinkPreviewStyle
Style of the preview
final
titleMaxLines int
Maximum number of lines for the title
final
url String
URL to load preview for
final
useCache bool
Whether to use caching
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<LinkPreviewBuilder>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

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