-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Change the way ActionDispatcher is found. #41245
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
Conversation
90df1ee to
eee0625
Compare
darrenaustin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Just some minor comments.
| }) | ||
| .map((DiagnosticsNode node) => node.toString()) | ||
| .toList(); | ||
| .where((DiagnosticsNode node) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why the change in indentation here? I thought it was supposed to be two spaces for this kind of expression.
| Element actionsElement; | ||
| Action action; | ||
|
|
||
| if (identical(intent, Intent.doNothing)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be good to have a test for this (unless I missed it below).
|
Crap. I didn't mean to commit this yet. I'll submit another PR that addresses your comments @darrenaustin |
This addresses comments in the original PR (#41245) that introduced Intent.doNothing, adds tests, and fixes an issue with it.
This changes the way ActionDispatchers are found by the Actions widget, so that by default it will look for dispatchers of the parent Actions widgets instead of just creating a default ActionDispatcher. This allows overriding of the ActionDispatcher at the top level: before, the custom action dispatcher would only be invoked if explicitly set on all the Actions widgets. This is not a breaking change because there was a default value to the dispatcher parameter before that performed this function, and not specifying the dispatcher anywhere will still result in a default dispatcher being created.
This addresses comments in the original PR (flutter#41245) that introduced Intent.doNothing, adds tests, and fixes an issue with it.
Description
This changes the way
ActionDispatchers are found by theActionswidget, so that by default it will look for dispatchers of the parent Actions widgets instead of just creating a defaultActionDispatcher. This allows overriding of the ActionDispatcher at the top level: before, the custom action dispatcher would only be invoked if explicitly set on all the Actions widgets.This is not a breaking change because there was a default value to the
dispatcherparameter before that performed this function, and not specifying the dispatcher anywhere will still result in a default dispatcher being created.Tests
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Does your PR require Flutter developers to manually update their apps to accommodate your change?