Lack of documentation for migration from js to js_interop #55352
Labels
area-web
Use area-web for Dart web related issues, including the DDC and dart2js compilers and JS interop.
type-documentation
A request to add or improve documentation
web-js-interop
Issues that impact all js interop
With the recent beta release of wasm for flutter i wanted to try compling my application to the new target. As (somewhat) expected i ran into some js interop issues.
I tried to switch to the new package
import 'dart:js_interop';
but struggled to get it working as there seems to be very litte documentation on how to do the migration.Old code
Diff
The error i am getting is
Error: The '@JS' annotation from 'dart:js_interop' can only be used for static interop, either through extension types or '@staticInterop' classes.
I found some documentation in https://dart.dev/interop/js-interop/usage
e.g.
Before converting all the code in my dart js warper i would like to be sure that this is the correct approach. It would be great if you could also provide some concrete side by side examples of old js vs new js_interop code in the documentation.
Config
The text was updated successfully, but these errors were encountered: