-
Notifications
You must be signed in to change notification settings - Fork 6k
Add null-aware access to semantics instance #40146
Add null-aware access to semantics instance #40146
Conversation
mdebbar
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.
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 |
| 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?
yjbanov
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.
…er/engine#40146) (#122610) Commit: 9449c4c95e9b4db03ec61c0686d180c21488bd13

We are making calls on a
SemanticsTextEditingStrategy.instancethat 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
///).