-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Deprecate TextInputConnection.setStyle #13016
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
Open
koji-1009
wants to merge
8
commits into
flutter:main
Choose a base branch
from
koji-1009:text_input_connection
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+77
−0
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8d23cb3
Deprecate TextInputConnection.setStyle
koji-1009 09d5e24
Update src/content/release/breaking-changes/deprecate-text-input-conn…
koji-1009 2a641e5
Fix sort order in breaking changes index
koji-1009 6156a0e
Update src/content/release/breaking-changes/deprecate-text-input-conn…
koji-1009 4541978
Merge branch 'main' into text_input_connection
parlough ea82970
Merge branch 'main' into text_input_connection
sfshaza2 ca77bbd
Revert "Fix sort order in breaking changes index"
koji-1009 9d7215e
Sort my breaking change in index page
koji-1009 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
75 changes: 75 additions & 0 deletions
75
src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,75 @@ | ||
| title: Deprecate `TextInputConnection.setStyle` | ||
| description: >- | ||
| The `TextInputConnection.setStyle` method has been deprecated in favor | ||
| of the `TextInputConnection.updateStyle` method. | ||
| --- | ||
|
|
||
| {% render "docs/breaking-changes.md" %} | ||
|
|
||
| ## Summary | ||
|
|
||
| `TextInputConnection.setStyle` is deprecated in favor of | ||
| `TextInputConnection.updateStyle`, which supports synchronizing | ||
| `letterSpacing`, `wordSpacing`, and `lineHeight` to the engine. | ||
|
|
||
| ## Context | ||
|
|
||
| The previous `setStyle` method did not support `letterSpacing`, `wordSpacing`, | ||
| or `lineHeight`. This caused visual misalignment of the selection highlight | ||
| and IME caret when these properties were used. | ||
|
|
||
| The replacement `updateStyle` method (via `TextInputStyle`) supports these | ||
| properties, ensuring the system input is synchronized with the rendered text. | ||
|
|
||
| ## Migration guide | ||
|
|
||
| Authors of custom text input clients should replace calls to | ||
| `TextInputConnection.setStyle` with `TextInputConnection.updateStyle`. | ||
|
|
||
| ### Code before migration: | ||
|
|
||
| ```dart | ||
| connection.setStyle( | ||
| fontFamily: 'Roboto', | ||
| fontSize: 14.0, | ||
| fontWeight: FontWeight.normal, | ||
| textDirection: TextDirection.ltr, | ||
| textAlign: TextAlign.start, | ||
| ); | ||
| ``` | ||
|
|
||
| ### Code after migration: | ||
|
|
||
| ```dart | ||
| connection.updateStyle( | ||
| TextInputStyle( | ||
| fontFamily: 'Roboto', | ||
| fontSize: 14.0, | ||
| fontWeight: FontWeight.normal, | ||
| textDirection: TextDirection.ltr, | ||
| textAlign: TextAlign.start, | ||
| letterSpacing: 1.2, | ||
| wordSpacing: 1.0, | ||
| lineHeight: 1.5, | ||
| ), | ||
| ); | ||
| ``` | ||
|
|
||
| ## Timeline | ||
|
|
||
| Landed in version: TBD<br> | ||
| In stable release: Not yet | ||
|
|
||
| ## References | ||
|
|
||
| Relevant PR: | ||
|
|
||
| * [PR 180436][] | ||
|
|
||
| Relevant issues: | ||
|
|
||
| * [Issue 161592][] | ||
|
|
||
| <!-- Stable channel link: --> | ||
| [PR 180436]: {{site.repo.flutter}}/pull/180436 | ||
| [Issue 161592]: {{site.repo.flutter}}/issues/161592 | ||
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
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.
Uh oh!
There was an error while loading. Please reload this page.