Skip to content

Conversation

@moffatman
Copy link
Contributor

DraggableScrollableSheet was rebuilding every time the size of the child changed, which meant every frame during a drag. Now it will only rebuild when it gets changed parameters from the parent widget.

Also inadvertent fix to an exception thrown while rebuilding DraggableScrollableSheet with a new controller.

Fixes #67219

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.

@flutter-dashboard flutter-dashboard bot added f: scrolling Viewports, list views, slivers, etc. framework flutter/packages/flutter repository. See also f: labels. labels Sep 6, 2022
@bugrevealingbme
Copy link

I need this.

// If an external facing controller was provided, let it know that the
// extent has been replaced.
widget.controller?._onExtentReplaced(previousExtent);
if (widget.controller?.isAttached ?? false) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious why the new controller doesn't attached now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Actually, I realized that new controller is still not handled properly (_attach is only called in initState, never if we have a new controller). This isn't really related to my change, I found it while writing the test, where I wanted to show that builder was still called when we have a new controller. Going to update the changeset with proper change for giving a new controller.

Copy link
Member

Choose a reason for hiding this comment

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

So this maybe another issue we should fix, right?
Maybe we should fix it in a separate file instead of temporarily circumventing it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved it to #111445

@kamami
Copy link

kamami commented Sep 9, 2022

Any updates on this fix?

Copy link
Member

@xu-baolin xu-baolin left a comment

Choose a reason for hiding this comment

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

LGTM

@moffatman moffatman added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 13, 2022
@auto-submit auto-submit bot merged commit 7b5241b into flutter:master Sep 13, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 14, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/plugins that referenced this pull request Sep 14, 2022
CaseyHillers pushed a commit to CaseyHillers/flutter that referenced this pull request Sep 23, 2022
CaseyHillers pushed a commit to CaseyHillers/flutter that referenced this pull request Sep 23, 2022
CaseyHillers pushed a commit that referenced this pull request Sep 23, 2022
* Revert "Fix changing DraggableScrollableSheet controller (#111445)"

This reverts commit 0322b57.

* Revert "Fix DraggableScrollableSheet rebuilding during drag (#111010)"

This reverts commit 7b5241b.
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.

DraggableScrollableSheet is rebuilding the screen while dragging

4 participants