Package io.flutter.embedding.engine.systemchannels

# Interface PlatformViewsChannel.PlatformViewsHandler

All Known Implementing Classes:
  `PlatformViewsControllerDelegator`

Enclosing class:
  `PlatformViewsChannel`

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

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

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final long`
  `NON_TEXTURE_FALLBACK`

- ## 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`
  `createForPlatformViewLayer(PlatformViewCreationRequest request)`
  The Flutter application would like to display a new Android `View`, i.e., platform view.
  `long`
  `createForTextureLayer(PlatformViewCreationRequest request)`
  The Flutter application would like to display a new Android `View`, i.e., platform view.
  `void`
  `createPlatformViewHcpp(PlatformViewCreationRequest request)`
  `void`
  `dispose(int viewId)`
  The Flutter application would like to dispose of an existing Android `View`.
  `boolean`
  `isHcppEnabled()`
  Returns true if creation of HC++ platform views is currently supported.
  `void`
  `offset(int viewId, double top, double left)`
  The Flutter application would like to change the offset of an existing Android `View`.
  `void`
  `onTouch(PlatformViewTouch touch)`
  The user touched a platform view within Flutter.
  `void`
  `resize(PlatformViewsChannel.PlatformViewResizeRequest request, PlatformViewsChannel.PlatformViewBufferResized onComplete)`
  The Flutter application would like to resize an existing Android `View`.
  `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.
  `void`
  `synchronizeToNativeViewHierarchy(boolean yes)`
  Whether the render surface of `FlutterView` should be converted to a `FlutterImageView` when a `PlatformView` is added.

- ## Field Details

  - ### NON_TEXTURE_FALLBACK

    static final long NON_TEXTURE_FALLBACK
    See Also:
      - Constant Field Values

- ## Method Details

  - ### createForPlatformViewLayer

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

    The Android View is added to the view hierarchy. This view is rendered in the Flutter framework by a PlatformViewLayer.

    Parameters:
      `request` - The metadata sent from the framework.

  - ### isHcppEnabled

    boolean isHcppEnabled()
    Returns true if creation of HC++ platform views is currently supported.

  - ### createPlatformViewHcpp

    void createPlatformViewHcpp(@NonNull PlatformViewCreationRequest request)

  - ### createForTextureLayer

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

    The Android View is added to the view hierarchy. This view is rendered in the Flutter framework by a TextureLayer.

    Parameters:
      `request` - The metadata sent from the framework.
    Returns:
      The texture ID.

  - ### dispose

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

  - ### resize

    void resize(@NonNull PlatformViewsChannel.PlatformViewResizeRequest request, @NonNull PlatformViewsChannel.PlatformViewBufferResized onComplete)
    The Flutter application would like to resize an existing Android `View`.
    Parameters:
      `request` - The request to resize the platform view.
      `onComplete` - Once the resize is completed, this is the handler to notify the size of the platform view buffer.

  - ### offset

    void offset(int viewId, double top, double left)
    The Flutter application would like to change the offset 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.

  - ### synchronizeToNativeViewHierarchy

    void synchronizeToNativeViewHierarchy(boolean yes)
    Whether the render surface of `FlutterView` should be converted to a `FlutterImageView` when a `PlatformView` is added.

    This is done to syncronize the rendering of the PlatformView and the FlutterView. Defaults to true.