Skip to content

Add updateStyle method to TextInputConnectionDecorator#2950

Merged
matthew-carroll merged 9 commits into
mainfrom
renzo_implement-updateStyle
Feb 26, 2026
Merged

Add updateStyle method to TextInputConnectionDecorator#2950
matthew-carroll merged 9 commits into
mainfrom
renzo_implement-updateStyle

Conversation

@matthew-carroll

Copy link
Copy Markdown
Contributor

Copied from @Renzo-Olivares PR:

In flutter/flutter#180436 a breaking change was introduced to pass additional styling information to the web engine in order to fix flutter/flutter#161592. Historically the framework passes this information using TextInputConnection.setStyle(......), however after the breaking change the framework introduced TextInputConnection.updateStyle(TextInputStyle style) and deprecated the old method in an effort to minimize future breaking changes when passing additional style parameters to the engine.

This change fixes the breakage by adding an implementation for the new method added TextInputConnection.updateStyle.

A full migration to updateStyle in addition to providing the additional styling information to the web engine will still be needed if experiencing flutter/flutter#161592.

#2917

@matthew-carroll matthew-carroll merged commit b422c32 into main Feb 26, 2026
23 checks passed
@matthew-carroll matthew-carroll deleted the renzo_implement-updateStyle branch February 26, 2026 02:36
github-actions Bot pushed a commit that referenced this pull request Feb 26, 2026
tsavo-at-pieces added a commit to pieces-app/super_editor that referenced this pull request May 9, 2026
…lutter 3.35-3.40 compat)

Upstream commit b422c32 (PR Flutter-Bounty-Hunters#2950, Feb 2026) added:

  @OverRide
  void updateStyle(TextInputStyle style) => client?.updateStyle(style);

to TextInputConnectionDecorator in anticipation of Flutter's
"Deprecate TextInputConnection.setStyle" breaking change
(flutter/flutter#180436), which adds TextInputConnection.updateStyle(
TextInputStyle) and deprecates setStyle(...).

Per docs.flutter.dev/release/breaking-changes/deprecate-text-input-
connection-set-style (last updated 2026-03-03), the change is "Landed
in version: TBD / In stable release: Not yet."

Our pinned Flutter is 3.35.7 (`flutter --version`):
  - flutter-sdk-3.35.5/packages/flutter/lib/src/services/text_input.dart
    declares only `void setStyle({...})`. There is no `class TextInputStyle`
    and no `void updateStyle(...)` on TextInputConnection.
  - TextInputConnectionDecorator implements TextInputConnection, so the
    override fails to compile: "TextInputStyle isn't a type" + "method
    updateStyle isn't defined for the type TextInputConnection".

There is no Dart conditional-imports trick that can selectively
include an interface override based on host SDK version (conditional
imports switch libraries, not class members).

Fix: drop the override and replace it with a comment block that:
  - Explains the upstream origin (PR Flutter-Bounty-Hunters#2950, commits 4703643 / b422c32).
  - Cites the Flutter breaking-change doc.
  - Documents restore criteria (when Flutter ships TextInputStyle in
    stable AND we upgrade past that release).

This is a no-op functionally on stable Flutter: setStyle(...) above
already covers the entire surviving public API; the framework can't
call a method that doesn't exist on the parent class.

Tracked as fork divergence #6 in FORK_CHANGES.md, marked as
TEMPORARY. Will be re-asserted on each upstream sync until either
upstream gates this on a Flutter version constraint or we upgrade
past the TextInputStyle-shipping stable release.

Refs: #13 (parent merge PR)
matthew-carroll added a commit that referenced this pull request May 26, 2026
…2951)

[Super Editor] - Flutter breaking change fix: Add updateStyle method to TextInputConnectionDecorator (#2950)

Co-authored-by: Matt Carroll <matthew-carroll@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Incorrect position of Japanese predictive conversion popup in TextFormField using maxLines on the Web

2 participants