Package io.flutter.embedding.engine.systemchannels

# Class PlatformViewsChannel2

java.lang.Object
io.flutter.embedding.engine.systemchannels.PlatformViewsChannel2

public class PlatformViewsChannel2 extends Object
System channel that sends 2-way communication between Flutter and Android to facilitate embedding of Android Views within a Flutter application.

Register a `PlatformViewsChannel2.PlatformViewsHandler` to implement the Android side of this channel.

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `static class`
  `PlatformViewsChannel2.PlatformViewCreationRequest`
  Request sent from Flutter to create a new platform view.
  `static interface`
  `PlatformViewsChannel2.PlatformViewsHandler`
  Handler that receives platform view messages sent from Flutter to Android through a given `PlatformViewsChannel`.
  `static class`
  `PlatformViewsChannel2.PlatformViewTouch`
  The state of a touch event in Flutter within a platform view.

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `PlatformViewsChannel2(DartExecutor dartExecutor)`
  Constructs a `PlatformViewsChannel` that connects Android to the Dart code running in `dartExecutor`.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `invokeViewFocused(int viewId)`
  `void`
  `setPlatformViewsHandler(PlatformViewsChannel2.PlatformViewsHandler handler)`
  Sets the `PlatformViewsChannel2.PlatformViewsHandler` which receives all events and requests that are parsed from the underlying platform views channel.

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### PlatformViewsChannel2

    public PlatformViewsChannel2(@NonNull DartExecutor dartExecutor)
    Constructs a `PlatformViewsChannel` that connects Android to the Dart code running in `dartExecutor`.

    The given `dartExecutor` is permitted to be idle or executing code.

    See `DartExecutor`.

- ## Method Details

  - ### invokeViewFocused

    public void invokeViewFocused(int viewId)

  - ### setPlatformViewsHandler

    public void setPlatformViewsHandler(@Nullable PlatformViewsChannel2.PlatformViewsHandler handler)
    Sets the `PlatformViewsChannel2.PlatformViewsHandler` which receives all events and requests that are parsed from the underlying platform views channel.