A new method,`void showAutocorrectionPromptRect(int start, int end)`, was added to the `TextInputClient` interface.
Original behavior
In order to display the iOS autocorrection highlight, the iOS text input plugin needed a way to inform the Flutter framework of the highlight's start and end position.
New behavior
A new method, `void showAutocorrectionPromptRect(int start, int end)`, was added to the `TextInputClient` interface. iOS calls this method when it finds a new potential autocorrect candidate in the current user input, or when the range of a previously highlighted candidate changes.
- Who is affected
- Applications and packages relying on the previous behaviour or signature. Code that uses TextInputClient, State.
- Practical impact
- Behaviour or API differences that can break builds or change runtime behaviour.
- What action should I take?
- Follow the official migration guide below, update affected call sites, run `dart fix --apply` where a fix is available, then run your tests.
Official migration guide (excerpt, © The Flutter Authors, CC BY 3.0)
If your application doesn't implement or subclass TextInputClient,
no migration is needed. If your application doesn't target iOS,
or the class that implemented the textInputClient interface doesn't
support autocorrect, you only need to add an empty implementation
for the new method:
class CustomTextInputClient implements TextInputClient {
void showAutocorrectionPromptRect(int start, int end) {}
}Otherwise, if your app targets iOS and supports autocorrect on iOS,
we recommend that you add a sensible implementation of
void showAutocorrectionPromptRect(int start, int end)
to your TextInputClient subclass.
Code after migration:
// Assume your `TextInputClient` is a `State` subclass, and it has a variable
// `_currentPromptRectRange` that controls the autocorrection highlight.
class CustomTextInputClient extends State<...> implements TextInputClient {
@override
void updateEditingValue(TextEditingValue value) {
// When the text changes, the highlight needs to be dismissed.
if (value.text != _value.text) {
setState(() {
_currentPromptRectRange = null;
});
}
}
void _handleFocusChanged() {
// When this text input loses focus, the autocorrection highlight needs
// to be dismissed.
if (!_hasFocus) {
setState(() {
_currentPromptRectRange = null;
});
}
}
@override
void showAutocorrectionPromptRect(int start, int end) {
// Updates the range of the highlight, as iOS requested.
// This method isn't called when iOS decides to
// dismiss the highlight.
setState(() {
_currentPromptRectRange = TextRange(start: start, end: end);
});
}
}AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.Listed in the official breaking-changes index (docs.flutter.dev/release/breaking-changes).
An official announcement or migration guide documents an intended behaviour or API change. A verified source change (git diff) shows code changed but does not by itself prove a public API is breaking. AI interpretations are labelled and never used to classify a change.
- Source commit
- b3045439b7c0
- Source last updated
- Oct 21, 2026
- Last synchronized
- Oct 21, 2026
- Publication status
- published
Publication history
- Oct 21, 2026, 8:31 PM: new → published (ingestion) — Backed by an official breaking-change/migration guide.
AI_PROVIDER (for example to openai-compatible with a local Ollama or LM Studio endpoint) to enable grounded explanations. Everything else on this page works without an AI provider.