LMChatGIF
File location
gif.dart
LMChatGIF is a widget to display and control GIF animations within the chat interface. It supports autoplay, customizable styles, and overlay elements.
Properties
media(LMChatMediaModel)
Contains the GIF data to be displayed.fps(int?)
The frames per second for the GIF animation.overlay(Widget?)
An optional widget to overlay on top of the GIF.
Note: These properties are only a subset. More can be found inside the widget class.
Styling
LMChatGIFStyle
File location
gif.dart
LMChatGIFStyle defines the appearance of the GIF widget, including size, fit, and overlay options.
| Property | Type | Description | Required | Default |
|---|---|---|---|---|
width | double? | Width of the GIF container | No | None |
borderRadius | BorderRadius? | Border radius of the GIF container | No | 8.0 |
overlayColor | Color? | Color of the overlay container | No | Black (50%) |
Note: These properties are only a subset. More can be found inside the style class.
Example Usage
final gifWidget = LMChatGIF(
media: mediaData,
fps: 24,
overlay: Icon(Icons.play_arrow, color: Colors.white),
style: LMChatGIFStyle(
width: 100.0,
borderRadius: BorderRadius.circular(8),
overlayColor: Colors.black.withOpacity(0.5),
),
);