This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Add null-aware access to semantics instance#40146
Merged
htoor3 merged 10 commits intoflutter:mainfrom Mar 14, 2023
Merged
Conversation
Contributor
Author
mdebbar
approved these changes
Mar 8, 2023
mdebbar
reviewed
Mar 8, 2023
Contributor
Author
|
@mdebbar thoughts on whether I should add to this PR the change we discussed a few days ago on this line - where we move that conditional out?Are there are situations in which semantics gets enabled before we hit |
yjbanov
reviewed
Mar 13, 2023
| editableElement?.remove(); | ||
| } | ||
| SemanticsTextEditingStrategy.instance.deactivate(this); | ||
| SemanticsTextEditingStrategy._instance?.deactivate(this); |
Contributor
There was a problem hiding this comment.
Is it possible to add an engine test that simulates the situation where dispose is called before the strategy is initialized?
Contributor
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. |
htoor3
commented
Mar 13, 2023
| semantics().semanticsEnabled = false; | ||
| }); | ||
|
|
||
| test('Calling dispose() pre-initialization will not throw an error', () { |
Contributor
Author
There was a problem hiding this comment.
@yjbanov would something like this work?
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Mar 14, 2023
sourcegraph-bot
pushed a commit
to sgtest/megarepo
that referenced
this pull request
Mar 14, 2023
…er/engine#40146) (#122610) Commit: 9449c4c95e9b4db03ec61c0686d180c21488bd13
Merged
8 tasks
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
Mar 15, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
May 10, 2023
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/packages
that referenced
this pull request
May 10, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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
///).