BubbleLinkPreview class
Link preview bubble widget for displaying URL previews
This widget displays a message with a link preview card showing metadata like title, description, and image from the URL.
The BorderRadius can be customized using bubbleRadius
url is the URL to preview
title is the title extracted from the URL
description is the description extracted from the URL
imageUrl is the preview image URL
text is the message text (optional)
isSender determines if the message is from the sender or receiver
color can be customized for the bubble background
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatelessWidget
- BubbleLinkPreview
Constructors
- BubbleLinkPreview({Key? key, required String url, String? title, String? description, String? imageUrl, String? text, double bubbleRadius = defaultBubbleRadiusLinkPreview, bool isSender = true, Color color = Colors.white70, Color? previewBackgroundColor, bool tail = true, bool sent = false, bool delivered = false, bool seen = false, TextStyle textStyle = const TextStyle(color: Colors.black87, fontSize: 16), TextStyle? titleTextStyle, TextStyle? descriptionTextStyle, TextStyle? urlTextStyle, BoxConstraints? constraints, Widget? leading, Widget? trailing, EdgeInsets margin = EdgeInsets.zero, EdgeInsets padding = const EdgeInsets.symmetric(horizontal: 12, vertical: 8), VoidCallback? onTap, VoidCallback? onLongPress, VoidCallback? onLinkTap, double? imageHeight = 150, bool showImage = true})
-
Creates a BubbleLinkPreview widget
const
Properties
- bubbleRadius → double
-
chat bubble BorderRadius
final
- color → Color
-
chat bubble color
final
- constraints → BoxConstraints?
-
constraints for the chat bubble
final
- delivered → bool
-
message state - whether the message has been delivered
final
- description → String?
-
the description of the link preview
final
- descriptionTextStyle → TextStyle?
-
text style for the link preview description
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- imageHeight → double?
-
height of the preview image
final
- imageUrl → String?
-
the preview image URL
final
- isSender → bool
-
message sender
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leading → Widget?
-
widget displayed before the bubble for non-senders
final
- margin → EdgeInsets
-
outer margin of the bubble
final
- onLinkTap → VoidCallback?
-
callback function when the link preview is tapped
final
- onLongPress → VoidCallback?
-
callback function when the bubble is long pressed
final
- onTap → VoidCallback?
-
callback function when the bubble is tapped
final
- padding → EdgeInsets
-
inner padding of the bubble
final
- previewBackgroundColor → Color?
-
link preview card background color
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- seen → bool
-
message state - whether the message has been seen
final
- sent → bool
-
message state - whether the message has been sent
final
- showImage → bool
-
whether to show the preview image
final
- tail → bool
-
chat bubble tail
final
- text → String?
-
optional message text accompanying the link
final
- textStyle → TextStyle
-
text style for the message text
final
- title → String?
-
the title of the link preview
final
- titleTextStyle → TextStyle?
-
text style for the link preview title
final
- trailing → Widget?
-
widget displayed after the bubble for senders
final
- url → String
-
the URL being previewed
final
- urlTextStyle → TextStyle?
-
text style for the URL
final
Methods
-
build(
BuildContext context) → Widget -
Describes the part of the user interface represented by this widget.
override
-
createElement(
) → StatelessElement -
Creates a StatelessElement to manage this widget's location in the tree.
inherited
-
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