Skip to main content

LMChatText

File location
text.dart

LMChatText is a reusable text widget designed for use throughout the chat interface. It provides high customizability through styles and supports interaction with onTap functionality.

Properties

  1. text (String)
    The text content to display.

  2. onTap (Function()?)
    An optional callback function triggered on tapping the text.

  3. style (LMChatTextStyle?)
    Customizes the appearance of the text widget.

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


Styling

LMChatTextStyle

File location
text.dart

LMChatTextStyle defines the visual appearance of the text, including alignment, padding, and background configuration.

PropertyTypeDescriptionRequiredDefault
textAlignTextAlign?Alignment of the textNoTextAlign.start
textStyleTextStyle?Styling for the text appearanceNoDefault TextStyle
paddingEdgeInsetsGeometry?Padding around the text boxNoEdgeInsets.zero
backgroundColorColor?Background color of the text boxNoTransparent
borderRadiusdouble?Border radius for the text boxNo4.0

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


Example Usage

final chatText = LMChatText(
'Hello, World!',
style: LMChatTextStyle(
textAlign: TextAlign.center,
textStyle: TextStyle(fontSize: 16, fontWeight: FontWeight.bold),
padding: EdgeInsets.all(8.0),
backgroundColor: Colors.blue.withOpacity(0.1),
borderRadius: 8.0,
),
onTap: () => print('Text tapped'),
);