pana
pana copied to clipboard
Hybrid package incorrectly marked as Flutter-only
Related to: https://github.com/dart-lang/pub/issues/3563
I recently published native_storage which is a hybrid package, capable of being used in Dart-only and Flutter contexts. It has no direct or transitive dependencies on the Flutter SDK.
It does, however, declare a flutter manifest in the pubspec.yaml for the cases in which the host project is a Flutter app:
https://github.com/celest-dev/celest/blob/32f3c44241468951e07470109f1dc4f1fc266283/packages/native/storage/pubspec.yaml#L45-L49
This causes pana to label the package as Flutter-only due to the following:
https://github.com/dart-lang/pana/blob/375a861a566e7d08872cb2d6fe47ef83ab12486e/lib/src/pubspec.dart#L63-L64
Yeah we don't have a good story for hybrid packages yet.
A related issue to this is that if a Dart package depends on a package which contains an environment.flutter key, but does not itself have one, pub will allow the package to be published, but pana completely flips out:
https://pub.dev/packages/celest/score