modules/flutter_chat_ui/src/util
library
Functions
-
calculateChatMessages(List<Message> messages, User user, {DateFormat? dateFormat, bool dateIsUtc = false, String? dateLocale, required int groupMessagesThreshold, double messagesSpacerHeight = 12, String? lastReadMessageId, required bool showUserNames, DateFormat? timeFormat})
→ List<Object>
-
Parses provided messages to chat messages (with headers and spacers)
and returns them with a gallery.
-
formatBytes(int size, [int fractionDigits = 2])
→ String
-
Returns text representation of a provided bytes value (e.g. 1kB, 1GB).
-
getUserAvatarNameColor(User user, List<Color> colors)
→ Color
-
Returns user avatar and name color based on the ID.
-
getUserInitials(User user)
→ String
-
Returns user initials (can have only first letter of firstName/lastName or both).
-
getUserName(User user)
→ String
-
Returns user name as joined firstName and lastName.
-
getVerboseDateTimeRepresentation(DateTime dateTime, {DateFormat? dateFormat, String? dateLocale, DateFormat? timeFormat})
→ String
-
Returns formatted date used as a divider between different days in the
chat history.
-
isConsistsOfEmojis(EmojiEnlargementBehavior emojiEnlargementBehavior, TextMessage message)
→ bool
-
Returns whether the
message
consists of a single emoji or multiple emojis
depending on the given emojiEnlargementBehavior
.