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
ogTags
(LMChatOGTagsViewData
)
The Open Graph tags to be displayed in the link preview bar.onCanceled
(VoidCallback?
)
Callback triggered when the link preview bar is canceled.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.
Property | Type | Description | Required | Default |
---|---|---|---|---|
innerPadding | EdgeInsetsGeometry? | Padding inside the preview bar | No | EdgeInsets.all(8) |
width | double? | Width of the preview bar container | No | 80.w |
titleStyle | LMChatTextStyle? | Text style for the title | No | Default 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,
),
),
),
);