From 81944fe0425b3c8767e283da8a4b103930f1e2af Mon Sep 17 00:00:00 2001 From: Lim Chee Kin Date: Tue, 20 Aug 2024 16:22:13 +0800 Subject: [PATCH] feat: expose shrinkWrap of CustomScrollView --- lib/src/infinite_list.dart | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/src/infinite_list.dart b/lib/src/infinite_list.dart index d71e781..4c53da8 100644 --- a/lib/src/infinite_list.dart +++ b/lib/src/infinite_list.dart @@ -32,6 +32,7 @@ class InfiniteList extends StatelessWidget { this.cacheExtent, this.debounceDuration = defaultDebounceDuration, this.reverse = false, + this.shrinkWrap = false, this.isLoading = false, this.hasError = false, this.hasReachedMax = false, @@ -76,6 +77,12 @@ class InfiniteList extends StatelessWidget { /// {@endtemplate} final bool reverse; + /// {@template shrinkWrap} + /// Indicates if the extent of the [ScrollView] in the [scrollDirection] + /// should be determined by the contents being viewed. + /// {@endtemplate} + final bool shrinkWrap; + /// {@template item_count} /// The amount of items that need to be rendered by the [itemBuilder]. /// @@ -200,6 +207,7 @@ class InfiniteList extends StatelessWidget { return CustomScrollView( scrollDirection: scrollDirection, reverse: reverse, + shrinkWrap: shrinkWrap, controller: scrollController, physics: physics, cacheExtent: cacheExtent,