Skip to content

fix: implement TextInputClient.onFocusReceived for Flutter >= 3.44 compatibility - #1226

Open
al-the-bear wants to merge 1 commit into
AppFlowy-IO:mainfrom
al-the-bear:pr/flutter-3.44-onfocusreceived
Open

fix: implement TextInputClient.onFocusReceived for Flutter >= 3.44 compatibility#1226
al-the-bear wants to merge 1 commit into
AppFlowy-IO:mainfrom
al-the-bear:pr/flutter-3.44-onfocusreceived

Conversation

@al-the-bear

Copy link
Copy Markdown

Problem

On Flutter 3.44+, appflowy_editor fails to compile with:

Missing concrete implementation of 'TextInputClient.onFocusReceived'.

Flutter 3.44 added TextInputClient.onFocusReceived() — a concrete member with a => false default on the TextInputClient mixin (packages/flutter/lib/src/services/text_input.dart). DeltaTextInputService mixes in DeltaTextInputClient, which only implements TextInputClient; the framework's default body does not carry over to an implements relationship, so the concrete class no longer satisfies the interface.

Fix

Add the onFocusReceived override to DeltaTextInputService, matching the framework default (=> false). It is a no-op on older Flutter versions where the member is unused, and restores compilation on 3.44+.

@override
bool onFocusReceived() => false;

Notes

  • Verified against Flutter 3.44.6 (stable).
  • Single-file, backward-compatible change; no behavior change on Flutter < 3.44.

Flutter 3.44 added `TextInputClient.onFocusReceived` (a concrete member
with a `=> false` default on the `TextInputClient` mixin). Because
`DeltaTextInputClient` only *implements* `TextInputClient`, the default
body does not carry over to `DeltaTextInputService`, so on Flutter >=
3.44 the class no longer satisfies the interface and fails to compile:

  Missing concrete implementation of 'TextInputClient.onFocusReceived'.

Provide the override, matching the framework default (`=> false`), so the
editor builds against Flutter 3.44+ while remaining a no-op on older
versions where the member is simply unused.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


al-the-bear seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

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.

2 participants