Skip to content
Discussion options

You must be logged in to vote

There are two parts to this.

  1. You should use package:universal_web, which already does the conditional import and stubbing for you, so you replace both package:web and dart:js_interop imports and don't need to use @Import.
  2. Any standard browser api should simply exist (e.g. window.alert()). For anything custom you should use the new js_interop way of doing things: https://dart.dev/interop/js-interop/usage#top-level-interop-members

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@sethcalebweeks
Comment options

@sethcalebweeks
Comment options

Answer selected by sethcalebweeks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants