flutter_js icon indicating copy to clipboard operation
flutter_js copied to clipboard

`import` and `require()` handler like the one in flutter_qjs

Open lin-calvin opened this issue 1 year ago • 7 comments

Would there be any things like this?

flutterJs.addModuleHandler((String name){return "export name=${name}";});

lin-calvin avatar Oct 28 '23 13:10 lin-calvin

I also need to use a library. is there an answer to this? I see the question is quite old

ekkis avatar Mar 13 '24 08:03 ekkis

mee too want to use some library inside js file, using require

khursheed33 avatar Apr 28 '24 11:04 khursheed33

this library doesn't seem to have any support but I found something I've made some contributions that will do what you want: https://pub.dev/packages/mercuryjs/example

ekkis avatar Apr 29 '24 20:04 ekkis

Hi @ekkis can you provide any example where you're calling async function written in js from dart using same package

khursheed33 avatar Apr 30 '24 08:04 khursheed33

Check out the openwebf server for support on using Mercury https://discord.gg/DvUBtXZ5rK

As for import / require, you're better off bundling your code. See this for an example on doing that.

MulverineX avatar May 01 '24 00:05 MulverineX

Hi @ekkis can you provide any example where you're calling async function written in js from dart using same package

wonderful news, Mercury has a new release where fetches work

ekkis avatar May 02 '24 01:05 ekkis

mee too want to use some library inside js file, using require

jadehh avatar Sep 01 '24 03:09 jadehh