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

Signed-off-by: xsahil03x <[email protected]>
This commit is contained in:
Sahil Kumar
2023-05-03 15:53:30 +05:30
committed by xsahil03x
parent b4413be47d
commit fbf9191795
2 changed files with 12 additions and 0 deletions
@@ -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`.
@@ -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,
@@ -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;
@@ -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;