Skip to main content

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

  1. media (LMChatMediaModel)
    Contains the GIF data to be displayed.

  2. fps (int?)
    The frames per second for the GIF animation.

  3. 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.

PropertyTypeDescriptionRequiredDefault
widthdouble?Width of the GIF containerNoNone
borderRadiusBorderRadius?Border radius of the GIF containerNo8.0
overlayColorColor?Color of the overlay containerNoBlack (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),
),
);