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
imageUrl
(String?
)
URL of the image to load from the network.imageFile
(File?
)
File object for local images.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.
Property | Type | Description | Required | Default |
---|---|---|---|---|
height | double? | Height of the image container | No | None |
borderRadius | BorderRadius? | Border radius of the image | No | 8.0 |
boxFit | BoxFit? | How the image should be fitted | No | Cover |
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'),
);