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
text(String)
The text content to display.onTap(Function()?)
An optional callback function triggered on tapping the text.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.
| Property | Type | Description | Required | Default |
|---|---|---|---|---|
textAlign | TextAlign? | Alignment of the text | No | TextAlign.start |
textStyle | TextStyle? | Styling for the text appearance | No | Default TextStyle |
padding | EdgeInsetsGeometry? | Padding around the text box | No | EdgeInsets.zero |
backgroundColor | Color? | Background color of the text box | No | Transparent |
borderRadius | double? | Border radius for the text box | No | 4.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'),
);