https://github.com/flutter/flutter/pull/143259 introduced handlers for Apps to respond to platform focus changes. We now need a mechanism to track which view currently has focus and notify the engine when focus shifts so the platform focus can be adjusted accordingly.
Proposal
My initial suggestion is to implement a simple view focus tracker utility. This would keep track of the currently focused view and inform the engine whenever focus changes through PlatformDispatcher.requestViewFocusChange calls.
Use case
https://github.com/flutter/flutter/pull/143259 introduced handlers for Apps to respond to platform focus changes. We now need a mechanism to track which view currently has focus and notify the engine when focus shifts so the platform focus can be adjusted accordingly.
Proposal
My initial suggestion is to implement a simple view focus tracker utility. This would keep track of the currently focused view and inform the engine whenever focus changes through
PlatformDispatcher.requestViewFocusChange
calls.A naive POC that works when there is only a single view in the app: https://github.com/tugorez/flutter/commit/5d302b86f1f9e85721db186e6868737aa60cc9d5