Skip to main content

LMChatBubble

File location
chat_bubble.dart

LMChatBubble displays a chat bubble in the interface, handling messages, avatars, and interactive actions.

Properties

  1. avatar (Widget?)
    Optional avatar displayed with the chat bubble.

  2. onTap (Function(bool isSelected, LMChatBubble bubble)?)
    Callback triggered on bubble tap.

  3. style (LMChatBubbleStyle?)
    Controls the appearance and layout of the chat bubble.

Note: These properties are only a subset. More can be found inside the widget class. You can refer to the relevant widget class for more reference.


Styling

LMChatBubbleStyle

File location
chat_bubble.dart

LMChatBubbleStyle provides customization for the appearance of the chat bubble.

PropertyTypeDescriptionRequiredDefault
backgroundColorColor?Background color for the bubbleNoTheme default
borderRadiusBorderRadius?Border radius of the bubbleNo8.0
selectedColorColor?Color when the bubble is selectedNoColor(0xFF006056)

Note: These properties are only a subset. More can be found inside the style class. You can refer to the relevant style class for more reference.


Example Usage

final chatBubble = LMChatBubble(
avatar: CircleAvatar(backgroundImage: NetworkImage('https://example.com/avatar.png')),
onTap: (isSelected, bubble) => print('Bubble selected: $isSelected'),
style: LMChatBubbleStyle(
backgroundColor: Colors.white,
selectedColor: Colors.green,
borderRadius: BorderRadius.circular(8.0),
),
);