Skip to main content

LMChatIcon

File location
icon.dart

LMChatIcon is a versatile widget used to display icons, SVGs, or PNGs within the chat interface. It supports multiple icon types with customizable styles for size, color, and fit.

Properties

  1. type (LMChatIconType)
    Defines the type of icon to display (e.g., icon, svg, or png).

  2. icon (IconData?)
    Icon data if the type is LMChatIconType.icon.

  3. assetPath (String?)
    Asset path for PNG or SVG icons.

  4. style (LMChatIconStyle?)
    Customizes the appearance of the icon.

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


Styling

LMChatIconStyle

File location
icon.dart

LMChatIconStyle defines the visual aspects of the icon, including size, padding, background color, and border.

PropertyTypeDescriptionRequiredDefault
colorColor?Color of the iconNoInherited theme
sizedouble?Size of the iconNo24.0
boxBorderRadiusdouble?Border radius of the icon boxNo0.0

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


Example Usage

final chatIcon = LMChatIcon(
type: LMChatIconType.icon,
icon: Icons.message,
style: LMChatIconStyle(
color: Colors.blue,
size: 32.0,
boxBorderRadius: 8.0,
),
);