Closed caleb-at-pieces closed 6 months ago
alright my issue was I was importing the 'Event' type from the dart:html package instead of the package:web/web.dart package
I'm all good now!
If you upgrade your SDK to something like 3.4, we've actually enabled this behavior (to use a dart:html
type in a function that gets toJS
'd) so that code can be a bit easier to migrate from dart:html
to package:web
. Granted, dart:html
still won't work on dart2wasm. At any rate, it looks like using the dart:html
type wasn't your intention anyways.
I am attempting to add an event listener on the window like so:
however whenever I try to build my application I get this build error:
I saw someone faced this same issue here https://github.com/dart-lang/web/issues/212#issuecomment-2041106649 however after trying to replicate their code I still face the same issue