Google is committed to advancing racial equity for Black communities. See how.

requestFocus method

*<Null safety>*

Future<void> requestFocus (int viewRef)

Requests that focus be transferred to the remote Scene represented by this connection.


Future<void> requestFocus(int viewRef) async {
  final args = <String, dynamic>{
    'viewRef': viewRef,

  final result =
      await platformViewChannel.invokeMethod('View.requestFocus', args);
  // Throw OSError if result is non-zero.
  if (result != 0) {
    throw OSError(
      'Failed to request focus for view: $viewRef with $result',