-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Add null-aware access to semantics instance #40146
Add null-aware access to semantics instance #40146
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.
Ship it!
@mdebbar thoughts on whether I should add to this PR the change we discussed a few days ago on this line
Are there are situations in which semantics gets enabled before we hit |
@@ -460,6 +460,6 @@ class TextField extends RoleManager { | |||
if (!isIosSafari) { | |||
editableElement?.remove(); | |||
} | |||
SemanticsTextEditingStrategy.instance.deactivate(this); | |||
SemanticsTextEditingStrategy._instance?.deactivate(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.
Is it possible to add an engine test that simulates the situation where dispose is called before the strategy is initialized?
It's up to you, but I would put it in a separate PR so it can be reverted independently in case it breaks something. |
semantics().semanticsEnabled = false; | ||
}); | ||
|
||
test('Calling dispose() pre-initialization will not throw an error', () { |
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.
@yjbanov would something like this work?
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.
…er/engine#40146) (#122610) Commit: 9449c4c95e9b4db03ec61c0686d180c21488bd13
We are making calls on a
SemanticsTextEditingStrategy.instance
that might be null in certain cases inside testing environments. We need to add conditional property access to these instances.Fixes flutter/flutter#122131
Pre-launch Checklist
///
).