Skip to content

Pub dry run meta package issue on Flutter #1830

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

Closed
anders-sandholm opened this issue Mar 19, 2018 · 3 comments
Closed

Pub dry run meta package issue on Flutter #1830

anders-sandholm opened this issue Mar 19, 2018 · 3 comments

Comments

@anders-sandholm
Copy link

From @lukef on March 5, 2018 17:49

Dart VM version: 2.0.0-dev.30.0 (Thu Feb 22 14:08:47 2018 +0100) on "macos_x64"
Flutter: master

If you use the @required annotation and combine it with import 'package:meta/meta.dart'; then pub publish --dry-run will report that the meta package is not used. If it is replaced with import 'package:flutter/foundation.dart'; then the problem goes away.

Copied from original issue: dart-lang/sdk#32418

@matanlurey
Copy link
Contributor

@lukef: Do you have package:meta in your dependencies: ... (pubspec.yaml)?

Even though Flutter provides some of them in foundation.dart, it's considered a warning to not depend directly on package:meta. Was that intentional?

@lukef
Copy link

lukef commented Mar 19, 2018

@matanlurey - I don't have that package in my pubspec. That's good to know. The reason I was using foundation.dart was for the @required annotation so foundation is probably fine in this case.

This is more a Flutter issue (which I raised over there) but, in general, its one of those cases where it's semi-unclear which one to use because dart + flutter overlap. My mindset was to use the dart package but, in hindsight, I don't have a super good reason for why I picked that one. Is there guidance either way? I'd be happy to submit a Flutter documentation PR / Issue also.

@matanlurey
Copy link
Contributor

Anything that has package: ... needs a dependencies: ... for it (or dev_dependencies if just used for your test or tool folder). Seems like a doc issue then 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants