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: expose shrinkWrap of CustomScrollView #71

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
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
8 changes: 8 additions & 0 deletions lib/src/infinite_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -76,6 +77,12 @@ class InfiniteList extends StatelessWidget {
/// {@endtemplate}
final bool reverse;

/// {@template shrinkWrap}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: If the @template is not being used elsewhere in a @macro we should remove the @template.

/// Indicates if the extent of the [ScrollView] in the [scrollDirection]
/// should be determined by the contents being viewed.
/// {@endtemplate}
Comment on lines +82 to +83
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: consider referencing the property that the value is proxying to.

Suggested change
/// should be determined by the contents being viewed.
/// {@endtemplate}
/// should be determined by the contents being viewed.
///
/// See also:
///
/// * [CustomScrollView.shrinkWrap], for more details about this flag.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are you waiting for my response?

I not sure how to "add some tests to ensure the property gets proxied into CustomScrollView and ensure false is the default?"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @limcheekin sorry for the late reply, you can try having a look at a recent PR: #76, to get inspired on how to test it.

final bool shrinkWrap;

/// {@template item_count}
/// The amount of items that need to be rendered by the [itemBuilder].
///
Expand Down Expand Up @@ -200,6 +207,7 @@ class InfiniteList extends StatelessWidget {
return CustomScrollView(
scrollDirection: scrollDirection,
reverse: reverse,
shrinkWrap: shrinkWrap,
controller: scrollController,
physics: physics,
cacheExtent: cacheExtent,
Expand Down