io.flutter.embedding.engine.plugins.FlutterPlugin

import

io.flutter.embedding.engine.plugins.FlutterPlugin.FlutterPluginBinding

class

PlatformViewPlugin

FlutterPlugin

override

fun

onAttachedToEngine

binding

FlutterPluginBinding

binding

platformViewRegistry

registerViewFactory

"<platform-view-type>"

NativeViewFactory

())

override

fun

onDetachedFromEngine

binding

FlutterPluginBinding

{}

In your native code, implement the following:

Extend io.flutter.plugin.platform.PlatformView
to provide a reference to the android.view.View
(for example, NativeView.java):