简体   繁体   中英

How to access js file function from dart file for the mobile application flutter?

I want to access the function which I have defined in js file and I need to access that function from my dart file,

I have followed the following way for the access, but when I am trying to access that function from dart file for the web, it's working fine, But when I am going to access that for mobile app (Android and iOS), then getting an error,

Error:

Error: Not found: 'dart:js' import 'dart:js'

Ref: https://fireship.io/snippets/using-js-with-flutter-web/

If anyone help for this situation?

Inset import 'dart:js' on the very top of your code

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