requestViewFocusChange method

  1. @override
void requestViewFocusChange({
  1. required int viewId,
  2. required ViewFocusState state,
  3. required ViewFocusDirection direction,
})
override

Requests a focus change of the FlutterView with ID viewId.

If an app would like to request the engine to move focus, in forward direction, to the FlutterView with ID 1 it should call this method with ViewFocusState.focused and ViewFocusDirection.forward.

There is no need to call this method if the view in question already has focus as it won't have any effect.

A call to this method will lead to the engine calling onViewFocusChange if the request is successfully fulfilled.

See also:

Implementation

@override
void requestViewFocusChange({
  required int viewId,
  required ViewFocusState state,
  required ViewFocusDirection direction,
}) {
  _testFocusEvents.add(
    ViewFocusEvent(
      viewId: viewId,
      state: state,
      direction: direction,
    ),
  );
  _platformDispatcher.requestViewFocusChange(viewId: viewId, state: state, direction: direction);
}