Skip to content

Cannot make package that is both a flutter plugin, and has a dart-only side also #8656

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
MichealReed opened this issue Mar 20, 2025 · 5 comments

Comments

@MichealReed
Copy link

MichealReed commented Mar 20, 2025

I recently published an update to the package https://pub.dev/packages/minigpu. Before this update, I was using plugins for all platforms, but with 1.0.1 I migrated the library to use native assets. Now that I have published this version, only web shows up for compatibility per the pub.dev analyzer.

This package should show as dart compatible and support all native platforms + web. I am only using a plugin now for web, native assets use the new build hook.

Is there any way to force this until recognition of native assets can be added to the analyzer?

cc: @dcharkes

@dcharkes
Copy link
Contributor

This is a known issue, cc @jonasfj

Somewhat related, also about surfacing supported platforms from hooks:

@sigurdm
Copy link
Contributor

sigurdm commented Mar 20, 2025

You can override the detected list of supported platforms by explicitly declaring them: https://pub.dev/help/scoring#:~:text=Declaring%20platforms%3A

@MichealReed
Copy link
Author

You can override the detected list of supported platforms by explicitly declaring them: https://pub.dev/help/scoring#:~:text=Declaring%20platforms%3A

Thanks! Any way to specifically declare dart compatibility too?

@sigurdm
Copy link
Contributor

sigurdm commented Mar 20, 2025

No, we haven't yet figured out how to make packages that are flutter plugins sometimes and dart ffi apps sometimes.

Currently the best (but perhaps unsatisfying) advice is to make two separate plugins.

@MichealReed
Copy link
Author

No, we haven't yet figured out how to make packages that are flutter plugins sometimes and dart ffi apps sometimes.

It seems the main hold-up on this is the analyzer forcing the use of flutter pub get when a nested dep relies on a flutter package. If the nested check was disabled or a flag to disable it was introduced, wouldn't these flow as dart packages?

Yes my package nests a web dependency that relies on flutter, native never uses this package so it is never called and should validate as dart.

@sigurdm sigurdm changed the title Native Assets Package showing as Flutter and only web Cannot make package that is both a flutter plugin, and has a dart-only side also Mar 27, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants