Skip to content

Commit

Permalink
fix: scrollToBottom not respecting false value
Browse files Browse the repository at this point in the history
  • Loading branch information
HayesGordon committed Feb 18, 2022
1 parent b4182a0 commit cfb41dd
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
1 change: 1 addition & 0 deletions packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
🐞 Fixed

- [[#888]](https://github.com/GetStream/stream-chat-flutter/issues/888) Fix `unban` command not working in `MessageInput`.
- Fix `showScrollToBottom` in `MessageListView` not respecting false value.

## 3.4.0
- Updated `stream_chat_flutter_core` dependency to [`3.4.0`](https://pub.dev/packages/stream_chat_flutter_core/changelog).
Expand Down
27 changes: 14 additions & 13 deletions packages/stream_chat_flutter/lib/src/message_list_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -712,20 +712,21 @@ class _MessageListViewState extends State<MessageListView> {
);
},
),
BetterStreamBuilder<bool>(
stream: streamChannel!.channel.state!.isUpToDateStream,
initialData: streamChannel!.channel.state!.isUpToDate,
builder: (context, snapshot) => ValueListenableBuilder<bool>(
valueListenable: _showScrollToBottom,
child: _buildScrollToBottom(),
builder: (context, value, child) {
if (!snapshot || value) {
return child!;
}
return const Offstage();
},
if (widget.showScrollToBottom)
BetterStreamBuilder<bool>(
stream: streamChannel!.channel.state!.isUpToDateStream,
initialData: streamChannel!.channel.state!.isUpToDate,
builder: (context, snapshot) => ValueListenableBuilder<bool>(
valueListenable: _showScrollToBottom,
child: _buildScrollToBottom(),
builder: (context, value, child) {
if (!snapshot || value) {
return child!;
}
return const Offstage();
},
),
),
),
if (widget.showFloatingDateDivider)
_buildFloatingDateDivider(itemCount),
],
Expand Down

0 comments on commit cfb41dd

Please sign in to comment.