Google celebrates Hispanic Heritage Month. 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 FuchsiaViewsService.instance.platformViewChannel
      .invokeMethod('View.focus.request', args);
  // Throw OSError if result is non-zero.
  if (result != 0) {
    throw OSError(
      'Failed to request focus for view: $viewRef with $result',