Skip to main content

LMChatImage

File location
image.dart

LMChatImage displays images within a chat interface. It supports multiple sources (network, file, asset) and allows customization through style and error handling.

Properties

  1. imageUrl (String?)
    URL of the image to load from the network.

  2. imageFile (File?)
    File object for local images.

  3. style (LMChatImageStyle?)
    Controls the appearance and layout of the image.

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


Styling

LMChatImageStyle

File location
image.dart

LMChatImageStyle allows customization of the image widget, including dimensions, borders, padding, and background.

PropertyTypeDescriptionRequiredDefault
heightdouble?Height of the image containerNoNone
borderRadiusBorderRadius?Border radius of the imageNo8.0
boxFitBoxFit?How the image should be fittedNoCover

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


Example Usage

final chatImage = LMChatImage(
imageUrl: 'https://example.com/image.png',
style: LMChatImageStyle(
height: 150.0,
borderRadius: BorderRadius.circular(8.0),
boxFit: BoxFit.cover,
),
onTap: () => print('Image tapped'),
);