X Tutup
The Wayback Machine - https://web.archive.org/web/20220113044424/https://github.com/flutter/flutter/pull/96089
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

Make DraggableScrollableController a ChangeNotifier #96089

Merged

Conversation

@caseycrogers
Copy link
Contributor

@caseycrogers caseycrogers commented Jan 3, 2022

This PR allows developers to add listeners on DraggableScrollableController that fire whenever an attached sheet's size changes. Listening for changes is already possible via DraggableScrollableNotification. This PR is still useful because:

  1. Depending on the situation, it is often much easier to register a listener on a controller than by using a notification listener. See: https://github.com/ueman/feedback/blob/642bcea820708cf0490a31209c928c03e04c6b2d/feedback/lib/src/feedback_widget.dart#L61
  2. Other controllers (such as scroll controller) are change notifiers so developers will expect the same form DraggableScrollableController.

Fixes #96088

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.

@caseycrogers caseycrogers requested a review from goderbauer Jan 8, 2022
Copy link
Member

@goderbauer goderbauer left a comment

LGTM

@goderbauer
Copy link
Member

@goderbauer goderbauer commented Jan 12, 2022

@dnfield Can you do a secondary review?

@fluttergithubbot fluttergithubbot merged commit b4777c3 into flutter:master Jan 13, 2022
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

4 participants
X Tutup