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

Clean up scrollable.dart for 2D #122357

Merged
merged 2 commits into from
Mar 10, 2023
Merged

Conversation

Piinks
Copy link
Contributor

@Piinks Piinks commented Mar 10, 2023

Part of the 2D scrolling proposal: flutter.dev/go/2D-Foundation

Part of #122355 (tests will be migrated separately for validation)

This relocates some public APIs to another file in order to make some breathing room for TwoDimensionalScrollable.

  • ScrollableDetails
  • EdgeDraggingAutoScroller
  • ScrollIncrementCalculator
  • ScrollIncrementType
  • ScrollIncrementDetails
  • ScrollIncrementIntent
  • ScrollAction

I also tidied up some getters that were scattered throughout ScrollableState.

This required exposing 2 new getters on ScrollableState

  • resolvedPhysics
    • I actually think this is super beneficial to add. The way physics are applied internally can be difficult for users to debug. This makes what the actual physics ended up being way more accessible.
  • deltaToScrollOrigin
    • Used by the EdgeDraggingAutoScroller. Simple look up that seems harmless to expose, it is a simple method for computing the axis oriented absolute value of the distance from the 0 position.

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.

@Piinks Piinks added team Infra upgrades, team productivity, code health, technical debt. See also team: labels. framework flutter/packages/flutter repository. See also f: labels. f: scrolling Viewports, list views, slivers, etc. c: tech-debt Technical debt, code quality, testing, etc. labels Mar 10, 2023
@flutter-dashboard flutter-dashboard bot added the a: text input Entering text in a text field or keyboard related problems label Mar 10, 2023
@reidbaker reidbaker self-requested a review March 10, 2023 18:42
Copy link
Contributor

@reidbaker reidbaker left a comment

Choose a reason for hiding this comment

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

I have a mild preference for scrollable_helpers to have its own test file but I can see the value in showing that the existing tests still pass after the move.

@Piinks
Copy link
Contributor Author

Piinks commented Mar 10, 2023

I concur! I will move the related tests into a new file in a separate PR to ensure ensure everything still checks out. 👍

@Piinks Piinks added the autosubmit Merge PR when tree becomes green via auto submit App label Mar 10, 2023
@auto-submit auto-submit bot merged commit 7ce8869 into flutter:master Mar 10, 2023
hannah-hyj pushed a commit to hannah-hyj/flutter that referenced this pull request Mar 11, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 11, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Mar 12, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request May 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a: text input Entering text in a text field or keyboard related problems autosubmit Merge PR when tree becomes green via auto submit App c: tech-debt Technical debt, code quality, testing, etc. f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. team Infra upgrades, team productivity, code health, technical debt. See also team: labels.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants