| |
| |
| |
| # requestFocus method |
| |
| |
| |
| |
| *[<Null safety>](https://dart.dev/null-safety)* |
| |
| |
| |
| - @override |
| |
| Future<void> requestFocus |
| ([int _ = 0]) |
| |
| _<span class="feature override">override</span>_ |
| |
| |
| |
| <p>Requests that focus be transferred to the remote Scene represented by |
| this connection. This method is the point at which focus handling for |
| flatland diverges. In Flatland, the Flutter engine holds the ViewRef |
| and does not provide it to dart code, so we must refer to the child |
| view by viewId instead</p> |
| |
| |
| |
| ## Implementation |
| |
| ```dart |
| @override |
| Future<void> requestFocus([int _ = 0]) async { |
| if (useFlatland) { |
| return super.requestFocusById(viewId); |
| } else { |
| assert(viewRef?.reference != null && _ == 0); |
| return super.requestFocus(viewRef!.reference.handle!.handle); |
| } |
| } |
| ``` |
| |
| |
| |
| |
| |
| |
| |