From 8d23cb3c77a2ed2423863df143bc5902c91e72ff Mon Sep 17 00:00:00 2001 From: Koji Wakamiya Date: Tue, 3 Feb 2026 09:15:55 +0900 Subject: [PATCH 1/6] Deprecate TextInputConnection.setStyle --- ...precate-text-input-connection-set-style.md | 74 +++++++++++++++++++ src/content/release/breaking-changes/index.md | 2 + 2 files changed, 76 insertions(+) create mode 100644 src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md diff --git a/src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md b/src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md new file mode 100644 index 0000000000..eada7eb0c7 --- /dev/null +++ b/src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md @@ -0,0 +1,74 @@ +title: Deprecate TextInputConnection.setStyle +description: >- + Syncs text metrics via `TextInputConnection.updateStyle` to fix IME and + selection alignment. Deprecates `setStyle`. +--- + +{% 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, + lineHeight: 1.5, + ), +); +``` + +## Timeline + +Landed in version: TBD
+In stable release: Not yet + +## References + +Relevant PR: + +* [PR 180436][] + +Relevant issues: + +* [Issue 161592][] + + +[PR 180436]: {{site.repo.flutter}}/pull/180436 +[Issue 161592]: {{site.repo.flutter}}/issues/161592 diff --git a/src/content/release/breaking-changes/index.md b/src/content/release/breaking-changes/index.md index 07ce977d3c..c833896073 100644 --- a/src/content/release/breaking-changes/index.md +++ b/src/content/release/breaking-changes/index.md @@ -43,6 +43,7 @@ They're sorted by release and listed in alphabetical order: * [Migrating Flutter Android app to Android Gradle Plugin 9.0.0][] * [Material 3 tokens update][] * [Page transition builders reorganization][] +* [Deprecate `TextInputConnection.setStyle`][] [Page transition builders reorganization]: /release/breaking-changes/decouple-page-transition-builders [Merged threads on Linux]: /release/breaking-changes/linux-merged-threads @@ -53,6 +54,7 @@ They're sorted by release and listed in alphabetical order: [Deprecate `findChildIndexCallback` in favor of `findItemIndexCallback` in `ListView` and `SliverList` separated constructors]: /release/breaking-changes/separated-builder-find-child-index-callback [Migrating Flutter Android app to Android Gradle Plugin 9.0.0]: /release/breaking-changes/migrate-to-agp-9 [Material 3 tokens update]: /release/breaking-changes/material-color-utilities +[Deprecate `TextInputConnection.setStyle`]: /release/breaking-changes/deprecate-text-input-connection-set-style ### Released in Flutter 3.38 From 09d5e24ff1114320eb7f5a71dff25472f9f8ca5c Mon Sep 17 00:00:00 2001 From: Koji Wakamiya Date: Tue, 3 Feb 2026 09:29:45 +0900 Subject: [PATCH 2/6] Update src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- .../deprecate-text-input-connection-set-style.md | 1 + 1 file changed, 1 insertion(+) diff --git a/src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md b/src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md index eada7eb0c7..ab0bbf31de 100644 --- a/src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md +++ b/src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md @@ -49,6 +49,7 @@ connection.updateStyle( textDirection: TextDirection.ltr, textAlign: TextAlign.start, letterSpacing: 1.2, + wordSpacing: 1.0, lineHeight: 1.5, ), ); From 2a641e54cc2f8fd92885c74afd02e2e29b470478 Mon Sep 17 00:00:00 2001 From: Koji Wakamiya Date: Tue, 3 Feb 2026 09:37:50 +0900 Subject: [PATCH 3/6] Fix sort order in breaking changes index --- src/content/release/breaking-changes/index.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/content/release/breaking-changes/index.md b/src/content/release/breaking-changes/index.md index c833896073..15a05deaff 100644 --- a/src/content/release/breaking-changes/index.md +++ b/src/content/release/breaking-changes/index.md @@ -36,25 +36,25 @@ They're sorted by release and listed in alphabetical order: ### Not yet released to stable -* [Merged threads on Linux][] -* [`FontWeight` also controls the weight attribute of variable fonts][] * [Deprecate `containsSemantics` in favor of `isSemantics`][] * [Deprecate `findChildIndexCallback` in favor of `findItemIndexCallback` in `ListView` and `SliverList` separated constructors][] -* [Migrating Flutter Android app to Android Gradle Plugin 9.0.0][] +* [Deprecate `TextInputConnection.setStyle`][] +* [`FontWeight` also controls the weight attribute of variable fonts][] * [Material 3 tokens update][] +* [Merged threads on Linux][] +* [Migrating Flutter Android app to Android Gradle Plugin 9.0.0][] * [Page transition builders reorganization][] -* [Deprecate `TextInputConnection.setStyle`][] -[Page transition builders reorganization]: /release/breaking-changes/decouple-page-transition-builders -[Merged threads on Linux]: /release/breaking-changes/linux-merged-threads -[Stop generating `AssetManifest.json`]: /release/breaking-changes/asset-manifest-dot-json [`$FLUTTER_ROOT/version` replaced by `$FLUTTER_ROOT/bin/cache/flutter.version.json`]: /release/breaking-changes/flutter-root-version-file -[`FontWeight` also controls the weight attribute of variable fonts]: /release/breaking-changes/font-weight-variation [Deprecate `containsSemantics` in favor of `isSemantics`]: /release/breaking-changes/deprecate-contains-semantics [Deprecate `findChildIndexCallback` in favor of `findItemIndexCallback` in `ListView` and `SliverList` separated constructors]: /release/breaking-changes/separated-builder-find-child-index-callback -[Migrating Flutter Android app to Android Gradle Plugin 9.0.0]: /release/breaking-changes/migrate-to-agp-9 -[Material 3 tokens update]: /release/breaking-changes/material-color-utilities [Deprecate `TextInputConnection.setStyle`]: /release/breaking-changes/deprecate-text-input-connection-set-style +[`FontWeight` also controls the weight attribute of variable fonts]: /release/breaking-changes/font-weight-variation +[Material 3 tokens update]: /release/breaking-changes/material-color-utilities +[Merged threads on Linux]: /release/breaking-changes/linux-merged-threads +[Migrating Flutter Android app to Android Gradle Plugin 9.0.0]: /release/breaking-changes/migrate-to-agp-9 +[Page transition builders reorganization]: /release/breaking-changes/decouple-page-transition-builders +[Stop generating `AssetManifest.json`]: /release/breaking-changes/asset-manifest-dot-json ### Released in Flutter 3.38 From 6156a0edef2ac80b8025400fe3d2da389852aaa4 Mon Sep 17 00:00:00 2001 From: Koji Wakamiya Date: Wed, 4 Feb 2026 06:54:24 +0900 Subject: [PATCH 4/6] Update src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com> --- .../deprecate-text-input-connection-set-style.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md b/src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md index ab0bbf31de..2be4cba06a 100644 --- a/src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md +++ b/src/content/release/breaking-changes/deprecate-text-input-connection-set-style.md @@ -1,7 +1,7 @@ -title: Deprecate TextInputConnection.setStyle +title: Deprecate `TextInputConnection.setStyle` description: >- - Syncs text metrics via `TextInputConnection.updateStyle` to fix IME and - selection alignment. Deprecates `setStyle`. + The `TextInputConnection.setStyle` method has been deprecated in favor + of the `TextInputConnection.updateStyle` method. --- {% render "docs/breaking-changes.md" %} From ca77bbd0a26e36407d1d2860b5608d04dd632280 Mon Sep 17 00:00:00 2001 From: Koji Wakamiya Date: Thu, 5 Feb 2026 07:02:53 +0900 Subject: [PATCH 5/6] Revert "Fix sort order in breaking changes index" This reverts commit 2a641e54cc2f8fd92885c74afd02e2e29b470478. --- src/content/release/breaking-changes/index.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/content/release/breaking-changes/index.md b/src/content/release/breaking-changes/index.md index 15a05deaff..c833896073 100644 --- a/src/content/release/breaking-changes/index.md +++ b/src/content/release/breaking-changes/index.md @@ -36,25 +36,25 @@ They're sorted by release and listed in alphabetical order: ### Not yet released to stable +* [Merged threads on Linux][] +* [`FontWeight` also controls the weight attribute of variable fonts][] * [Deprecate `containsSemantics` in favor of `isSemantics`][] * [Deprecate `findChildIndexCallback` in favor of `findItemIndexCallback` in `ListView` and `SliverList` separated constructors][] -* [Deprecate `TextInputConnection.setStyle`][] -* [`FontWeight` also controls the weight attribute of variable fonts][] -* [Material 3 tokens update][] -* [Merged threads on Linux][] * [Migrating Flutter Android app to Android Gradle Plugin 9.0.0][] +* [Material 3 tokens update][] * [Page transition builders reorganization][] +* [Deprecate `TextInputConnection.setStyle`][] +[Page transition builders reorganization]: /release/breaking-changes/decouple-page-transition-builders +[Merged threads on Linux]: /release/breaking-changes/linux-merged-threads +[Stop generating `AssetManifest.json`]: /release/breaking-changes/asset-manifest-dot-json [`$FLUTTER_ROOT/version` replaced by `$FLUTTER_ROOT/bin/cache/flutter.version.json`]: /release/breaking-changes/flutter-root-version-file +[`FontWeight` also controls the weight attribute of variable fonts]: /release/breaking-changes/font-weight-variation [Deprecate `containsSemantics` in favor of `isSemantics`]: /release/breaking-changes/deprecate-contains-semantics [Deprecate `findChildIndexCallback` in favor of `findItemIndexCallback` in `ListView` and `SliverList` separated constructors]: /release/breaking-changes/separated-builder-find-child-index-callback -[Deprecate `TextInputConnection.setStyle`]: /release/breaking-changes/deprecate-text-input-connection-set-style -[`FontWeight` also controls the weight attribute of variable fonts]: /release/breaking-changes/font-weight-variation -[Material 3 tokens update]: /release/breaking-changes/material-color-utilities -[Merged threads on Linux]: /release/breaking-changes/linux-merged-threads [Migrating Flutter Android app to Android Gradle Plugin 9.0.0]: /release/breaking-changes/migrate-to-agp-9 -[Page transition builders reorganization]: /release/breaking-changes/decouple-page-transition-builders -[Stop generating `AssetManifest.json`]: /release/breaking-changes/asset-manifest-dot-json +[Material 3 tokens update]: /release/breaking-changes/material-color-utilities +[Deprecate `TextInputConnection.setStyle`]: /release/breaking-changes/deprecate-text-input-connection-set-style ### Released in Flutter 3.38 From 9d7215ec0fbb4737cce043622506c751b37df39f Mon Sep 17 00:00:00 2001 From: Koji Wakamiya Date: Thu, 5 Feb 2026 07:06:44 +0900 Subject: [PATCH 6/6] Sort my breaking change in index page --- src/content/release/breaking-changes/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/content/release/breaking-changes/index.md b/src/content/release/breaking-changes/index.md index c833896073..4b4378e7b3 100644 --- a/src/content/release/breaking-changes/index.md +++ b/src/content/release/breaking-changes/index.md @@ -40,10 +40,10 @@ They're sorted by release and listed in alphabetical order: * [`FontWeight` also controls the weight attribute of variable fonts][] * [Deprecate `containsSemantics` in favor of `isSemantics`][] * [Deprecate `findChildIndexCallback` in favor of `findItemIndexCallback` in `ListView` and `SliverList` separated constructors][] +* [Deprecate `TextInputConnection.setStyle`][] * [Migrating Flutter Android app to Android Gradle Plugin 9.0.0][] * [Material 3 tokens update][] * [Page transition builders reorganization][] -* [Deprecate `TextInputConnection.setStyle`][] [Page transition builders reorganization]: /release/breaking-changes/decouple-page-transition-builders [Merged threads on Linux]: /release/breaking-changes/linux-merged-threads @@ -52,9 +52,9 @@ They're sorted by release and listed in alphabetical order: [`FontWeight` also controls the weight attribute of variable fonts]: /release/breaking-changes/font-weight-variation [Deprecate `containsSemantics` in favor of `isSemantics`]: /release/breaking-changes/deprecate-contains-semantics [Deprecate `findChildIndexCallback` in favor of `findItemIndexCallback` in `ListView` and `SliverList` separated constructors]: /release/breaking-changes/separated-builder-find-child-index-callback +[Deprecate `TextInputConnection.setStyle`]: /release/breaking-changes/deprecate-text-input-connection-set-style [Migrating Flutter Android app to Android Gradle Plugin 9.0.0]: /release/breaking-changes/migrate-to-agp-9 [Material 3 tokens update]: /release/breaking-changes/material-color-utilities -[Deprecate `TextInputConnection.setStyle`]: /release/breaking-changes/deprecate-text-input-connection-set-style ### Released in Flutter 3.38