Merge pull request #1042 from GetStream/hotfix/messageListViewInitialAlignment

fix(ui): message list view initial alignment
This commit is contained in:
Salvatore Giordano
2022-03-24 11:57:47 +01:00
committed by GitHub
2 changed files with 7 additions and 1 deletions
@@ -1,3 +1,9 @@
## Upcoming
🐞 Fixed
-[[#892]](https://github.com/GetStream/stream-chat-flutter/issues/892): Fix default `initialAlignment` in `MessageListView`.
## 3.5.1
🐞 Fixed
@@ -369,7 +369,7 @@ class _MessageListViewState extends State<MessageListView> {
double get _initialAlignment {
final initialAlignment = widget.initialAlignment;
if (initialAlignment != null) return initialAlignment;
return 0.1;
return streamChannel!.initialMessageId == null ? 0 : 0.1;
}
bool _isInitialMessage(String id) => streamChannel!.initialMessageId == id;