-
Notifications
You must be signed in to change notification settings - Fork 29.7k
ContextAction.isEnabled needs a context #127721
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
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.
| /// This finds the nearest _ancestor_ [Scrollable] if the `context`. This | |
| /// This finds the nearest _ancestor_ [Scrollable] of the `context`. This |
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.
fixed
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.
This design feels clunky. Perhaps it should just always return true from isEnabled, and instead do the search for the enabled action in invoke, doing nothing if nothing is enabled. Then at least the search for the first enabled action is happening coupled with the invocation.
That doesn't help with showing some kind of enabled feedback in the UI though.
Maybe something along the lines of your invokeActionIfEnabled would work better here, to combine the two steps. Oh, but you still have to implement the rest of the Action API, I guess. Ugh.
Not sure what the right answer is, but it feels clunky.
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.
I don't disagree but this PR doesn't affect any of that, I'm just documenting reality here.
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.
| /// This finds the nearest _ancestor_ [Scrollable] if the `context`. This | |
| /// This finds the nearest _ancestor_ [Scrollable] of the `context`. This |
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.
fixed
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.
Oooh, Dart 3 API. Nice.
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.
yeah i struggled with how to implement this for ages until i realised the answer was just to return... both pieces of information :-)
|
Fixed the docs error. |
gspencergoog
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.
|
Web failures are caused by dart-lang/sdk#52593. |
...and lots of things that fall out from that
flutter/flutter@95be76a...b0188cd 2023-06-15 [email protected] [web] Pass creation params to the platform view factory (flutter/flutter#128146) 2023-06-15 [email protected] [flutter_tools] cache flutter sdk version to disk (flutter/flutter#124558) 2023-06-14 [email protected] Fix inconsistently suffixed macOS flavored bundle directory (flutter/flutter#127997) 2023-06-14 [email protected] Update golden tests for material (flutter/flutter#128839) 2023-06-14 [email protected] Update getChildrenSummaryTree to handle Diagnosticable as input. (flutter/flutter#128833) 2023-06-14 [email protected] Improve the error message for non-normalized constraints (flutter/flutter#127906) 2023-06-14 [email protected] ContextAction.isEnabled needs a context (flutter/flutter#127721) 2023-06-14 [email protected] Remove temporary default case for PointerSignalKind (flutter/flutter#128900) 2023-06-14 [email protected] Respect allowlisted count of leaks. (flutter/flutter#128823) 2023-06-14 [email protected] Unpin flutter_plugin_android_lifecycle (flutter/flutter#128898) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC [email protected],[email protected],[email protected] on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

...and lots of things that fall out from that