dart-lang / pub-dev

The pub.dev website
https://pub.dev
BSD 3-Clause "New" or "Revised" License
802 stars 147 forks source link

mechanism to indicate package only supports dart and not flutter #6582

Open jonasfj opened 1 year ago

jonasfj commented 1 year ago

Since flutter web stuff can reasonably import dart:html and use things like localStorage (I assume), we can't detect that a package isn't really compatible with Flutter Web, just because it imports dart:html.

We could try to detect if it uses the DOM parts of dart:html, but that's probably not a good idea, you can use those parts in a flutter web app to compute styles, or maybe do something else.


We probably need a manual mechanism for indicating which SDKs a package is intended to be used with.

jonasfj commented 1 year ago

Somewhat similarly, we have problems creating packages that only conditionally import flutter.

jonasfj commented 1 year ago

We could argue that a package that imports dart:html, but doesn't have a dependency on flutter SDK (directly, or indirectly), does not support the Flutter SDK.

If we do logic this complicated we need mechanisms to override whatever is detected.