what I was trying to achieve is to embed a native view inside a flutter app. Something similar to what's explained here.
My problem is that i get the following error:
Unhandled Exception: PlatformException(error, java.lang.IllegalStateException: Trying to create a platform view of unregistered type: com.example.cat_app/textview
So I looked up how to register plugins. I tried the following code but cannot get it to work. Doing some research it seems that from flutter 1.12+ plugins register automatically so it's not needed to register them. But my code stills give the unregistered plugin error...
The following code gives me unresolved reference registrarFor error btw
class MainActivity: FlutterActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
GeneratedPluginRegistrant.registerWith(this)
WebViewPlugin.registerWith(this.registrarFor("com.yourPackageName"))
}
}
I'm stuck here and I don't know what should I do to register the plugin in the recent versions of Flutter. Is there any way I can achieve what I need? Thanks in advance