简体   繁体   中英

How to pass from an android activity to flutter?

I am working in an application where I would like to combine a code that I have developed in Android with Flutter.

More specifically, I have a login in Android where I would like to send me to the main that I have in Flutter.

I would like to know if I can pass from an Android activity to Flutter as I normally do in Android with the manifest.

Does anyone know if this is possible?

Yes, you can.

You can use a Platform View to achieve what you want, in this particular scenario, an AndroidView widget. It's more or less like a platform plugin, but this time, you're actually inlining native views in your widget tree.

It's not immediate and there are a few things that you need to setup before achieving it, so you should only do so if your activity is too complex to the point where it's not worth to recreate and maintain with Flutter widgets.

Nevertheless, I'll leave you with an article that goes through the process of creating the Android Platform View itself.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM