For more information, see the API docs for:

AndroidView

On the platform side

On the platform side, use the standard
io.flutter.plugin.platform package
in either Java or Kotlin:

Kotlin

Java

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.kt):

package

dev.flutter.example

import

android.content.Context

import

android.graphics.Color

import

android.widget.TextView

import

io.flutter.plugin.platform.PlatformView

internal

class

NativeView

context

Context

id