Releases: flyerhq/flutter_chat_ui
v2.3.1
Even though this is a patch release, it depends on flutter_chat_core
, which introduced a small breaking change. I realized I didn’t bump flutter_chat_ui
to a new minor version before publishing - sorry about that!
Fix is simple: if you have a custom ChatController, the set
operation now requires a messages array.
- If you were using named parameters like set(messages: messages), change it to: set(messages)
- If you previously used set() with no arguments, replace it with: set([])
v2.3.0
2.3.0
-
Renamed LinkPreview → LinkPreviewData
-
LinkPreview.imageUrl
→LinkPreviewData.image.url
-
Both
LinkPreviewData.image.width
andLinkPreviewData.image.height
are now required
2.2.4
- FIX: add physics param to the ChatAnimatedList(Reversed). (ede3a170)
- FIX: emptyChatList not clickable (#787). (88937baa)
2.2.3
2.2.2
2.2.1
- FIX: list rebuilding when keyboard opens/closes. (48e28e7e)
v2.2.0
2.2.0
ChatAnimatedList
Redesign:- Significantly overhauled for robust handling of asynchronous controller updates.
- The
update
operation (ChatOperation.update
) now requires theindex
of the message to be updated.
- CRITICAL: When implementing custom
ChatController
s, you MUST now fetch the most up-to-date message instance from your data source before passing it toremove
orupdate
operations. The internal list now relies on the exact object reference. Failing to do so will lead to errors or unexpected behavior. (SeeInMemoryChatController
for an example of fetching the actual message before emittingChatOperation.remove
orChatOperation.update
).
✨ Key Enhancements & Fixes ✨
- Asynchronous Operations:
ChatAnimatedList
now uses an internal operation queue to serialize updates, preventing race conditions and resolving priorStreamOperation
issues. - List Factorization: Common logic between normal and reversed
ChatAnimatedList
instances has been factorized, improving maintainability. - Bulk Insertions: Added
insertAllMessages
toChatController
andChatAnimatedList
for efficient bulk message additions with animations. - Diffing & Stability:
ChatController
'ssetMessages
now uses an improvedDiffUtil
(with move support), fixing "out of bounds" errors during complex list updates. - Data Consistency: The controller now fetches the latest message version before updates or deletions to ensure operations use current data.
- Bug Fixes:
- Testing: Introduced integration tests for
ChatAnimatedList
to validate list operations and item positioning.
- FIX: update operation not persisted in the list (#778). (37472015)
- FEAT: Fix StreamOperation Async issues / create insertAll / fixInsert on reverted list (#756). (60395f9b)
2.1.3
2.1.2
- FIX: add audio message type. (8d2b705a)
2.1.1
- FIX: add video message type. (93a13840)
2.1.0
2.1.0
Chat controller methods have been renamed to avoid name conflicts with Riverpod.
2.0.0
- Version 2.0.0 is a major update where we completely rebuilt the library. This version focuses on better performance, more customization options, and improved stability. We have added many new features and improvements to make your experience better. For more details, check out our blog post: https://flyer.chat/blog/v2-announcement/ 🚀
2.0.0-dev.11
- Enhanced pagination functionality for the
ChatAnimatedList
widget. If you utilize thepaginationThreshold
parameter, please refer to the comments in theChatAnimatedList
widget implementation for detailed guidance. - Updated the
Message
model to renameparentId
toreplyToMessageId
- The
createdAt
field is now optional in the message model - The
sending
field has been removed from the message model; instead, you can setsending: true
in the metadata of the Message model to achieve the same functionality. - The
isOnlyEmoji
property has been removed from the text message model; to indicate that a message contains only emojis, useisOnlyEmoji: true
in the metadata of the text message. - The
firstName
andlastName
fields in theUser
model have been consolidated into a singlename
field for improved simplicity. - The default sentinel values that previously allowed users to set specific properties to
null
have been removed. Instead, please useColors.transparent
,BorderRadius.zero
, orTextStyle()
to achieve the desired effect. Passingnull
will now use the standard configuration.
- Added a
headerWidget
to theChatMessage
widget, enabling the display of a custom header for each message. You have the flexibility to control the header's position; wrap it with aCenter
widget for centering. - Introduced new parameters:
sentMessageColumnAlignment
,receivedMessageColumnAlignment
,sentMessageRowAlignment
, andreceivedMessageRowAlignment
for theChatMessage
widget. These allow for precise control over the positioning ofleadingWidget
,trailingWidget
,topWidget
, andbottomWidget
. Ensure correct defaults are set for proper alignment, especially when using thetopWidget
. - Introduced
TextStreamMessage
type to support text streaming - Added
textStreamMessageBuilder
to theBuilders
class to support text streaming UI widget
Other changes
- Introduced
MessageID
andUserID
typedefs to provide clearer context, while maintaining their underlying type asString
s - Do not show status for received messages
- Added example for text streaming
2.0.0-dev.10
- Rename
ChatInput
toComposer
- Rename
ChatInputHeightNotifier
toComposerHeightNotifier
- Rename
inputBuilder
tocomposerBuilder
2.0.0-dev.9
- Requires Freezed 3.0.0
- Replace
status
field with a computed getter that determines message state based on lifecycle timestamps (createdAt
,deletedAt
,sending
,failedAt
,sentAt
,deliveredAt
,seenAt
,updatedAt
). This enables granular message history tracking and status transitions, matching the behavior of popular chat applications. - Rename
overlay
tohasOverlay
inImageMessage
Other changes
- Downgrade
intl
package version for better compatibility with other Flutter packages - Added
FileMessage
support to the example project - Migrated web storage implementation from
indexed_db
toidb_shim
for improved cross-platform compatibility and better performance
2.0.0-dev.8
- Package requires
intl
package for date/time formatting
- Added support for long press actions on messages with customizable callback
- Added system message for displaying system notifications and events in chat
- Added examples demonstrating both long press handling and system messages
- Added message status indicators (delivered, error, seen, sending, sent)
- Added message timestamps with customizable format, position
2.0.0-dev.7
- Changed dependency from
flutter_markdown
togpt_markdown
for theFlyerChatTextMessage
class onMessageTap
callback now includes message index and tap up details - updated parameters to(Message item, {int? index, TapUpDetails? details})
- Added more customization options to
ChatInput
, with default capitalization set to sentences - Changed default behavior of Enter key in
ChatInput
to create a newline instead of sending message- To send message on Enter, set
textInputAction: TextInputAction.send
when configuringChatInput
through builders - See
local.dart
example for how to use builders to customize input behavior
- To send message on Enter, set
- Add
ScrollToMessageMixin
to enable programmatic scrolling in chat list:scrollToMessage(messageId)
: Scrolls to a specific message by IDscrollToIndex(index)
: Scrolls to a message at a specific index- Both methods support customizable animation duration, curve, alignment and offset
- Can be used directly through any
ChatController
instance - See the pagination example in the example project for usage details
- Add validation to prevent duplicate message IDs
- Added support for sending messages using Shift+Enter keyboard shortcut in ChatInput
🐛 Bug Fixes
- Fixed flickering in avatar widget by implementing a user cache with LRU eviction strategy, allowing synchronous access to recently resolved user data