chat_message_timestamp 0.0.1 copy "chat_message_timestamp: ^0.0.1" to clipboard
chat_message_timestamp: ^0.0.1 copied to clipboard

A Flutter package for displaying chat messages with timestamps and sending status icons. Customize the appearance of chat bubbles, handle text overflow with a "show more" feature, and easily integrate [...]

Chat message Timestamped #

Flutter package write with RenderObject for writting chat messages with timestamps and sending status icons.

Preview #

here you have all the case possible

  • if sentAt fits on last line
  • if sentAt does not fit on last line
  • senAt with sending status icon
  • message with max lines

checkout the example table to see complete implementation

chat preview

Getting started #

add chat_message_timestamp in your flutter pubspec.yaml file

dependencies:
  chat_message_timestamp: //latest verison

import the package

import 'package:chat_message_timestamp/chat_message_timestamp.dart';

Usage #

use any shape you want such container ,card or customPainter then add it some padding and that's it. Simple right

Container(
    color: Colors.blue,
    padding: const EdgeInsets.all(15.0),
    child: TimestampedChatMessage(
        text:'your message here',
        sentAt:'your timestamp',
),
),

You have a litte helper extension on DateTime for formatting DateTime instance in this package named formattedTimeHm that you can use .

TimestampedChatMessage(
        text:'your message here',
        sentAt: DateTime.now().formattedTimeHm,// this will return a string of formatted date hm. ex: 13:06 

),

checkout the example tab to see a complete implementation of TimestampedChatMessage

Attributes #

here are the attributes of TimestampedChatMessage

text: the text of your message. This is a required String
sentAt: the timestamp of your message. This is a required String
style: this is the style of your message text. This is an optional TextStyle
sentAtStyle: this is the style of your timestamp text. This is an optional TextStyle
sendingStatusIcon: this is the icon the may want to add to your bubble. This is an optional Icon
maxLines: you can set the maximum lines of your message. Notice that the maxline number will be added each time you tapped on the 'showMore' textbutton it's not automaccally expanded the hole message but just add the amout of line maxLines specify. This is an optional Interger
delimiter: the delimiter string if the message have to show 'showMore' textbutton. By default it is three dots but can assign it to whatever you want. This is an optional String
showMoreText: the text of showMore if maxlines is specified et get reached. By default it is 'showMore'. This is an optional String
showMoreTextStyle: this is the style of your showMore text. This is an optional TextStyle

Notice #

The package does not automacally detect links yet and does not allow you to put clickable string either but it planned to be added in the next upgrade of the package.

Contribution #

Contributions are welcome! Before submitting a Pull Request, please refrain from introducing additional dependencies.

6
likes
150
pub points
72%
popularity

Publisher

unverified uploader

A Flutter package for displaying chat messages with timestamps and sending status icons. Customize the appearance of chat bubbles, handle text overflow with a "show more" feature, and easily integrate timestamps with a sending status indicator. Developed with a focus on modularity and extensibility for flexible usage in Flutter applications.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on chat_message_timestamp