Skip to main content

LMChatLinkPreviewBar

File location
link_preview_bar.dart

LMChatLinkPreviewBar displays a preview of a link on top of the chat bar text field. It supports customizable builders for different parts of the preview and style configurations.

Properties

  1. ogTags (LMChatOGTagsViewData)
    The Open Graph tags to be displayed in the link preview bar.

  2. onCanceled (VoidCallback?)
    Callback triggered when the link preview bar is canceled.

  3. style (LMChatLinkPreviewBarStyle?)
    Customizes the appearance of the link preview bar.

Note: These properties are only a subset. More can be found inside the widget class.


Styling

LMChatLinkPreviewBarStyle

File location
link_preview_bar.dart

LMChatLinkPreviewBarStyle defines the appearance of the link preview bar, including size, padding, and text style.

PropertyTypeDescriptionRequiredDefault
innerPaddingEdgeInsetsGeometry?Padding inside the preview barNoEdgeInsets.all(8)
widthdouble?Width of the preview bar containerNo80.w
titleStyleLMChatTextStyle?Text style for the titleNoDefault font size 14

Note: These properties are only a subset. More can be found inside the style class.


Example Usage

final linkPreviewBar = LMChatLinkPreviewBar(
ogTags: ogTagsData,
onCanceled: () => print('Link preview canceled'),
style: LMChatLinkPreviewBarStyle(
innerPadding: EdgeInsets.all(8.0),
width: 300.0,
titleStyle: LMChatTextStyle(
textStyle: TextStyle(
fontSize: 14,
fontWeight: FontWeight.w500,
),
),
),
);