Pub-dev: How can I tell if a a Flutter package works on iOS or Android?

Created on 17 May 2017  路  3Comments  路  Source: dart-lang/pub-dev

Would be nice if the package page showed me.

For example https://pub.dartlang.org/packages/fullscreen_mode is Android only, would be nice if pub told me that in a more regular format than a comment from the author.

Customer-Flutter blocked

Most helpful comment

It's one question whether a specific package provides iOS and/or Android specific code. @mit-mit Is there a way to detect this via pubspec.yaml:flutter or via another mechanism? (A simple flutter create foo will automatically create the ios and android folders, so I suspect the presence of these folders doesn't imply the developer actually wrote platform specific code)

It's another question whether a user can depend on a package and assume it will work on both platforms: It depends on the transitive closure of the given package. One could easily imagine a developer publishing a package A containing android-only code and another package B depends on A. So we could declare B as android-only as well. (Though this depends on the specific version of A selected during the pub get).

Maybe it would be better to introduce labels in pubspec.yaml files where developers can just declare on what platforms the package can be used.

All 3 comments

How would one detect that it is Android-only? The fullscreen_mode package has ios/ directory, and AFAICT the pubspec.yaml doesn't tell us anything about it.

It's one question whether a specific package provides iOS and/or Android specific code. @mit-mit Is there a way to detect this via pubspec.yaml:flutter or via another mechanism? (A simple flutter create foo will automatically create the ios and android folders, so I suspect the presence of these folders doesn't imply the developer actually wrote platform specific code)

It's another question whether a user can depend on a package and assume it will work on both platforms: It depends on the transitive closure of the given package. One could easily imagine a developer publishing a package A containing android-only code and another package B depends on A. So we could declare B as android-only as well. (Though this depends on the specific version of A selected during the pub get).

Maybe it would be better to introduce labels in pubspec.yaml files where developers can just declare on what platforms the package can be used.

There currently is no reliable way of determining this; logged https://github.com/flutter/flutter/issues/10288 on the Flutter side.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dilipkaklotar picture dilipkaklotar  路  3Comments

jimboyeah picture jimboyeah  路  5Comments

jorgecoca picture jorgecoca  路  3Comments

mit-mit picture mit-mit  路  6Comments

basilex picture basilex  路  3Comments