Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): add support for StreamMessageListView.shrinkWrap. #1520

Merged
merged 2 commits into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/stream_chat_flutter/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
),
```

- Added `StreamMessageListView.shrinkWrap` to allow users to shrink wrap the message list view.

🔄 Changed

- Deprecated `MessageTheme.linkBackgroundColor` in favor of `MessageTheme.urlAttachmentBackgroundColor`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class StreamMessageListView extends StatefulWidget {
this.unreadMessagesSeparatorBuilder,
this.messageListController,
this.reverse = true,
this.shrinkWrap = false,
this.paginationLimit = 20,
this.paginationLoadingIndicatorBuilder,
this.keyboardDismissBehavior = ScrollViewKeyboardDismissBehavior.onDrag,
Expand All @@ -135,6 +136,14 @@ class StreamMessageListView extends StatefulWidget {
/// See [ScrollView.reverse].
final bool reverse;

/// Whether the extent of the scroll view in the [scrollDirection] should be
/// determined by the contents being viewed.
///
/// Defaults to false.
///
/// See [ScrollView.shrinkWrap].
final bool shrinkWrap;

/// Limit used during pagination
final int paginationLimit;

Expand Down Expand Up @@ -550,6 +559,7 @@ class _StreamMessageListViewState extends State<StreamMessageListView> {
physics: widget.scrollPhysics,
itemScrollController: _scrollController,
reverse: widget.reverse,
shrinkWrap: widget.shrinkWrap,
itemCount: itemCount,
findChildIndexCallback: (Key key) {
final indexedKey = key as IndexedKey;
Expand Down