Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Added a clarification on scrollBehaviour in BoxScroll and ListView #107738

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

Merged
merged 3 commits into from
Jul 27, 2022

Conversation

snat-s
Copy link
Contributor

@snat-s snat-s commented Jul 15, 2022

Added a clarification on the docs of BoxScroll and ListView about the access that you have to ScrollBehavior. It seems that

List which issues are fixed by this PR. You must list at least one issue.
Fixes #98003

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@snat-s snat-s requested review from goderbauer and Piinks July 15, 2022 18:54
@flutter-dashboard flutter-dashboard bot added f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. labels Jul 15, 2022
Comment on lines 626 to 628
/// [ScrollBehavior] cannot be provided because it is only exposed
/// in widgets where the scrolling is hard-coded due to scrollbars and
/// overscroll indicators, or widget-specific [ScrollPhysics].
Copy link
Contributor

Choose a reason for hiding this comment

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

This kind of assumes the user is aware that other types of scrollable widgets can have a ScrollBehavior provided. If I do not know this, I read this and wonder, what do you mean scroll behavior?

Also, I realized mentioning physics here doesn't make sense since `physics' is a parameter that is already available.

What about something like...

Suggested change
/// [ScrollBehavior] cannot be provided because it is only exposed
/// in widgets where the scrolling is hard-coded due to scrollbars and
/// overscroll indicators, or widget-specific [ScrollPhysics].
/// [ScrollView]s are often decorated with [Scrollbar]s and overscroll indicators, which are managed by the inherited [ScrollBehavior]. Placing a [ScrollConfiguration] above a ScrollView can modify these behaviors for that ScrollView, or can be managed app-wide by providing a ScrollBehavior to [MaterialApp.scrollBehavior] or [CupertinoApp.scrollBehavior].

Feel free to adjust. Thanks for using a template!

@@ -620,6 +620,14 @@ class CustomScrollView extends ScrollView {

/// A [ScrollView] that uses a single child layout model.
///
/// {@template flutter.widgets.BoxScroll.scrollBehaviour}
/// ## Scrolling Behaviour
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit:

Suggested change
/// ## Scrolling Behaviour
/// ## Scrolling Behavior

@goderbauer goderbauer requested a review from Piinks July 26, 2022 22:18
Copy link
Member

@goderbauer goderbauer left a comment

Choose a reason for hiding this comment

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

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
autosubmit Merge PR when tree becomes green via auto submit App f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add scrollBehaviour to ListView and BoxScrollView
3 participants