Package io.flutter.embedding.engine.systemchannels

# Interface PlatformViewsChannel2.PlatformViewsHandler

Enclosing class:
  `PlatformViewsChannel2`

public static interface PlatformViewsChannel2.PlatformViewsHandler
Handler that receives platform view messages sent from Flutter to Android through a given `PlatformViewsChannel`.

To register a `PlatformViewsHandler` with a `PlatformViewsChannel2`, see `PlatformViewsChannel2.setPlatformViewsHandler(PlatformViewsHandler)`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `clearFocus(int viewId)`
  Clears the focus from the platform view with a give id if it is currently focused.
  `void`
  `createPlatformView(PlatformViewCreationRequest request)`
  The Flutter application would like to display a new Android `View`, i.e., platform view.
  `void`
  `dispose(int viewId)`
  The Flutter application would like to dispose of an existing Android `View`.
  `boolean`
  `isSurfaceControlEnabled()`
  Whether the SurfaceControl swapchain is enabled.
  `void`
  `onTouch(PlatformViewTouch touch)`
  The user touched a platform view within Flutter.
  `void`
  `setDirection(int viewId, int direction)`
  The Flutter application would like to change the layout direction of an existing Android `View`, i.e., platform view.

- ## Method Details

  - ### createPlatformView

    void createPlatformView(@NonNull PlatformViewCreationRequest request)
    The Flutter application would like to display a new Android `View`, i.e., platform view.

  - ### dispose

    void dispose(int viewId)
    The Flutter application would like to dispose of an existing Android `View`.

  - ### onTouch

    void onTouch(@NonNull PlatformViewTouch touch)
    The user touched a platform view within Flutter.

    Touch data is reported in `touch`.

  - ### setDirection

    void setDirection(int viewId, int direction)
    The Flutter application would like to change the layout direction of an existing Android `View`, i.e., platform view.

  - ### clearFocus

    void clearFocus(int viewId)
    Clears the focus from the platform view with a give id if it is currently focused.

  - ### isSurfaceControlEnabled

    boolean isSurfaceControlEnabled()
    Whether the SurfaceControl swapchain is enabled.