简体   繁体   中英

How to Call Native Android Code from Flutter web.?

I need to know is there any way to call platform specific code from flutter web.

basically I've android SDK integrated in the flutter project I'm successfully able to communicate with the SDK using the Method Channel from the APK generated from the project but when I run the project in flutter web project is unable to communicate with the SDK.

You don't call native mobile code from Flutter Web

Flutter on the Web is for Flutter apps running in a browser. Browser sites/apps are isolated from the full operating system.

The browsers have their own its own evolving JavaScript APIs, see: https://caniuse.com/ for what is possible depending on browser app/version. For example note that device orientation has some support while other browsers support accelerometer fully .

Flutter's platform channels allows for mobile developers to access mobile native APIs available to any installable mobile app (Android & iOS) or any additional native mobile libraries. For example browsers have no native machine learning API while in a mobile app you can package MLKit with a Flutter plugin .

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