Skip to main content

LMChatButton

File location
button.dart

LMChatButton is a customizable button widget used within the chat interface. It supports icons, text, and state management for active and inactive modes.

Properties

  1. isActive (bool)
    Indicates whether the button is active or inactive.

  2. text (LMChatText?)
    The text to display within the button.

  3. style (LMChatButtonStyle?)
    Customizes the button's appearance.

  4. onTap (VoidCallback?)
    Callback triggered when the button is tapped.

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


Styling

LMChatButtonStyle

File location
button.dart

LMChatButtonStyle defines the visual appearance of the button, including size, padding, colors, and icon placement.

PropertyTypeDescriptionRequiredDefault
backgroundColorColor?Background color of the buttonNoColors.transparent
borderRadiusdouble?Border radius of the buttonNo8.0
paddingEdgeInsets?Padding around the buttonNoEdgeInsets.all(4)

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


Example Usage

final chatButton = LMChatButton(
text: LMChatText('Send'),
isActive: true,
onTap: () => print('Button tapped'),
style: LMChatButtonStyle(
backgroundColor: Colors.blue,
borderRadius: 8.0,
padding: EdgeInsets.all(8.0),
),
);