Skip to content

Releases: flyerhq/flutter_chat_ui

v2.9.0

26 Jul 14:32
Compare
Choose a tag to compare

This release introduces two-sided pagination. You can now load newer messages using the new onStartReached callback, while onEndReached continues to work for older messages. For pagination to work correctly, messages should be inserted instantly, without animation.

To allow this and offer more granular control, a new optional animated parameter has been added to all controller operations except update. This is not a breaking change, but if you'd like to use it, you can update your controller like so:

insertMessage(Message message, {int? index}) // ❌
insertMessage(Message message, {int? index, bool animated = true}) // ✅
ChatOperation.insert(..., animated: animated) // add animated to insert operations

insertAllMessages(List<Message> messages, {int? index}) // ❌
insertAllMessages(List<Message> messages, {int? index, bool animated = true}) // ✅
ChatOperation.insertAll(..., animated: animated) // add animated to insertAll operations

removeMessage(Message message) // ❌
removeMessage(Message message, {bool animated = true}) // ✅
ChatOperation.remove(..., animated: animated) // add animated to remove operations

setMessages(List<Message> messages) // ❌
setMessages(List<Message> messages, {bool animated = true}) // ✅
ChatOperation.set(..., animated: animated) // add animated to set operations

As an optional improvement, you can use this parameter to disable animations when clearing the chat, which is now the default behaviour in the example apps.

ChatOperation.set(messages, animated: messages.isEmpty ? false : animated) // inside the controller

⚠️ There is a small potential breaking change: LoadMoreNotifier was updated for two-sided loading. If you used a custom LoadMore widget and used LoadMoreNotifier to measure its height, that logic has been removed as it was not used. Additionally, the internal property _isLoading is now _isLoadingOlder, and _isLoadingNewer has been added.

2.8.1

  • FIX: composer inputClearMode and fix custom editing controller. (b4872190)

v2.8.0

19 Jul 12:49
Compare
Choose a tag to compare
  • FEAT: allow for top widgets within the bubble (#814). (e267c27c)

v2.7.0

12 Jul 20:57
Compare
Choose a tag to compare

2.6.2

  • FIX: new loadingBuilder for stream message. (38d539ac)

2.6.1

  • FIX: add sendButtonDisabled and sendButtonHidden #828. (d476dd45)

v2.6.0

27 Jun 22:15
Compare
Choose a tag to compare

⚠️ Breaking Changes ⚠️

onMessageTap and onMessageLongPress added BuildContext as a first parameter, so if you had something like this:

void _handleMessageLongPress(
  Message message, {
  int? index,
  LongPressStartDetails? details,
})

replace it with this:

void _handleMessageLongPress(
  BuildContext context,
  Message message, {
  int? index,
  LongPressStartDetails? details,
})

  • FIX: scrollToIndex does not work when starting with an empty list #793. (1948c1f5)
  • FEAT: add sendButtonVisibilityMode and allowEmptyMessage to the composer. (7a496607)
  • FEAT: add method OnMessageDoubleTapCallback; add param BuildContext context for OnMessageTapCallback and OnMessageLongPressCallback (#817). (6fe68886)

2.5.3

2.5.2

  • Update a dependency to the latest release.

2.5.1

  • FIX: re-enable composer blur. (791f7308)

v2.5.0

08 Jun 17:57
Compare
Choose a tag to compare

v2.4.0

08 Jun 12:21
Compare
Choose a tag to compare

⚠️ Breaking Changes ⚠️

All message builders will also provide isSentByMe and groupStatus now. Just pass

{
  required bool isSentByMe,
  MessageGroupStatus? groupStatus,
}

after the index param. It is fine not to use these fields if not needed.


v2.3.1

26 May 21:58
Compare
Choose a tag to compare

⚠️ Breaking Changes ⚠️

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.

  1. If you were using named parameters like set(messages: messages), change it to: set(messages)
  2. If you previously used set() with no arguments, replace it with: set([])

  • FIX: add username widget. (892ee622)
  • FIX: expose user_cache and make it a changenotifier. (baa7eee6)
  • FIX: expose headers for avatar and image message. (0261ce1c)
  • FIX: gemini example with option to stop a stream. (fa558e46)
  • FEAT: make messages required for set operation. (9e123732)

v2.3.0

22 May 20:39
Compare
Choose a tag to compare

2.3.0

⚠️ Breaking Changes ⚠️

  • Renamed LinkPreviewLinkPreviewData

  • LinkPreview.imageUrlLinkPreviewData.image.url

  • Both LinkPreviewData.image.width and LinkPreviewData.image.height are now required

  • FEAT: link preview v2 (#784). (b65060e1)

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

17 May 14:11
Compare
Choose a tag to compare

2.2.0

⚠️ Breaking Changes ⚠️

  • ChatAnimatedList Redesign:
    • Significantly overhauled for robust handling of asynchronous controller updates.
    • The update operation (ChatOperation.update) now requires the index of the message to be updated.
  • CRITICAL: When implementing custom ChatControllers, you MUST now fetch the most up-to-date message instance from your data source before passing it to remove or update operations. The internal list now relies on the exact object reference. Failing to do so will lead to errors or unexpected behavior. (See InMemoryChatController for an example of fetching the actual message before emitting ChatOperation.remove or ChatOperation.update).

✨ Key Enhancements & Fixes ✨

  • Asynchronous Operations: ChatAnimatedList now uses an internal operation queue to serialize updates, preventing race conditions and resolving prior StreamOperation issues.
  • List Factorization: Common logic between normal and reversed ChatAnimatedList instances has been factorized, improving maintainability.
  • Bulk Insertions: Added insertAllMessages to ChatController and ChatAnimatedList for efficient bulk message additions with animations.
  • Diffing & Stability: ChatController's setMessages now uses an improved DiffUtil (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:
    • Corrected message insertion position in reversed lists (#754, #755).
    • Ensured message update operations are correctly persisted (#778).
  • 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

  • FIX: hide attachmentButton if no there is no onAttachmentTap provided (#757). (2eae2002)

2.1.2

  • FIX: add audio message type. (8d2b705a)

2.1.1

  • FIX: add video message type. (93a13840)

2.1.0

03 May 18:34
Compare
Choose a tag to compare

2.1.0

⚠️ Breaking Changes ⚠️

Chat controller methods have been renamed to avoid name conflicts with Riverpod.

  • insert -> insertMessage

  • update -> updateMessage

  • remove -> removeMessage

  • set -> setMessages

  • FEAT: rename chat controller methods. (dc1bf57d)

  • FIX: improve documentation and add example. (113141b3)

  • FIX: document public APIs.