-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Poor warnings when adding a Flutter plugin to a Dart app #47470
Comments
Not entirely sure what the right experience is, but this feels rough, cc @jonasfj @bwilkerson @jacob314 |
This is possible when:
As I recall we did pub#3045 to solves issues for tooling, see pub#2307. A reasonable opinion is that when we are able to locate a Flutter SDK, then Or at-least we should improve the error message, we can do better than:
|
I don't think the resolution should depend on where the
|
dependencies:
flutter:
sdk: flutter Is a direct-dependency on package "flutter" from "Flutter SDK". I don't think that's the correct way to express that something is a Flutter project. If we wanted apps to explicitly specify that they require Flutter SDK, then an SDK constraint would better: environment:
sdk: >=2.12.0 <3.0.0
flutter: >= 2.0.0 We already require the Dart SDK constraint to be present (expressed in We can reasonably make it a requirement for the root If we want to do this we'll need some buy-in from Flutter as this would affect a lot of Flutter users. |
Why? It literally says "I depend on the Flutter SDK"! |
Paging @jonasfj |
It says I depend on "package:flutter" from the Flutter SDK. I guess when writing Flutter a flutter app or package that is common though. I'm not sure what the right thing to do here is. Do we really want |
Maybe we should special case the error message: |
Yes, I hear you on the fact that there is a difference between SDK constraints and dependencies... Yes, perhaps fixing the messaging is enough. |
Repro steps:
dart create repro
add
url_launcher:under
dependencies:`dart pub get
=> No warning. Should we be saying something like
Warning: Package url_launcher requires the Flutter SDK
?bin/repro.dart
to contain:dart analyze
=> No warning. Should we be saying something like "Error: package:url_launcher requires the Flutter SDK"?
dart run
=> A huge amount of error output like:
The text was updated successfully, but these errors were encountered: