LMChatBubble
File location
chat_bubble.dart
LMChatBubble
displays a chat bubble in the interface, handling messages, avatars, and interactive actions.
Properties
avatar
(Widget?
)
Optional avatar displayed with the chat bubble.onTap
(Function(bool isSelected, LMChatBubble bubble)?
)
Callback triggered on bubble tap.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.
Property | Type | Description | Required | Default |
---|---|---|---|---|
backgroundColor | Color? | Background color for the bubble | No | Theme default |
borderRadius | BorderRadius? | Border radius of the bubble | No | 8.0 |
selectedColor | Color? | Color when the bubble is selected | No | Color(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),
),
);