Skip to content

Commit ca9ff84

Browse files
committed
chore: update CHANGELOG
1 parent af62f7f commit ca9ff84

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

packages/flutter_chat_ui/CHANGELOG.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,33 @@
11
## 2.9.0
22

3+
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.
4+
5+
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:
6+
```dart
7+
insertMessage(Message message, {int? index}) // ❌
8+
insertMessage(Message message, {int? index, bool animated = true}) // ✅
9+
ChatOperation.insert(..., animated: animated) // add animated to insert operations
10+
11+
insertAllMessages(List<Message> messages, {int? index}) // ❌
12+
insertAllMessages(List<Message> messages, {int? index, bool animated = true}) // ✅
13+
ChatOperation.insertAll(..., animated: animated) // add animated to insertAll operations
14+
15+
removeMessage(Message message) // ❌
16+
removeMessage(Message message, {bool animated = true}) // ✅
17+
ChatOperation.remove(..., animated: animated) // add animated to remove operations
18+
19+
setMessages(List<Message> messages) // ❌
20+
setMessages(List<Message> messages, {bool animated = true}) // ✅
21+
ChatOperation.set(..., animated: animated) // add animated to set operations
22+
```
23+
24+
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.
25+
```dart
26+
ChatOperation.set(messages, animated: messages.isEmpty ? false : animated) // inside the controller
27+
```
28+
29+
⚠️ 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.
30+
331
- **FEAT**: implement two-sided pagination ([#840](https://github.com/flyerhq/flutter_chat_ui/issues/840)). ([8cca3141](https://github.com/flyerhq/flutter_chat_ui/commit/8cca314116664216b9f1697fabde0eccfd1c582d))
432

533
## 2.8.1

0 commit comments

Comments
 (0)