onFocusReceived method

  1. @override
bool onFocusReceived()
override

Notifies the client that the platform moved focus back to this input.

This is necessary to support autofill on some browsers (e.g. iOS Safari) that blur the text field and refocus it before autofilling.

Returns true if the client acquired focus, false otherwise.

Implementation

@override
bool onFocusReceived() {
  // Returning false keeps the platform's default behavior (it will still
  // proceed to show the keyboard via showKeyboard()/show() as we already
  // drive that ourselves). We don't need custom focus-acquisition logic
  // here, but the override is mandatory on Flutter versions where
  // TextInputClient declares it without a default mixin implementation.
  return false;
}