Skip to main content

LMChatTile

File location
tile.dart

LMChatTile is a reusable widget for displaying content in a tile layout. It supports customizable child elements like leading icons, titles, subtitles, and trailing widgets.

Properties

  1. leading (Widget?)
    An optional widget displayed at the start of the tile.

  2. title (Widget?)
    The main title of the tile.

  3. onTap (VoidCallback?)
    Callback function triggered when the tile is tapped.

  4. style (LMChatTileStyle?)
    Defines the appearance of the tile.

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


Styling

LMChatTileStyle

File location
tile.dart

LMChatTileStyle allows for customization of the tile's appearance, including layout, colors, and spacing.

PropertyTypeDescriptionRequiredDefault
backgroundColorColor?Background color of the tileNoTransparent
borderRadiusdouble?Border radius of the tileNo0.0
paddingEdgeInsets?Padding inside the tileNoEdgeInsets.all(12)
heightdouble?Height of the tileNoNone

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


Example Usage

final chatTile = LMChatTile(
leading: Icon(Icons.person),
title: Text('John Doe'),
subtitle: Text('Active now'),
trailing: Icon(Icons.arrow_forward),
onTap: () => print('Tile tapped'),
style: LMChatTileStyle(
backgroundColor: Colors.white,
borderRadius: 8.0,
padding: EdgeInsets.all(16.0),
),
);