Closed yashpalzala closed 10 months ago
@yashpalzala it looks like you don't have flutter
listed as a dependency in your pubspec.yaml
. You should have something like:
dependencies:
flutter:
sdk: flutter
You should list all packages your project requires in dependencies
, including Flutter. This is what Dart-Code uses to determine whether your project is a Flutter project or not.
@yashpalzala it looks like you don't have
flutter
listed as a dependency in yourpubspec.yaml
. You should have something like:dependencies: flutter: sdk: flutter
You should list all packages your project requires in
dependencies
, including Flutter. This is what Dart-Code uses to determine whether your project is a Flutter project or not.
Yep, figured it just now. Thanks for your swift reply and solution.
np, glad it was something simple! :)
Hi @DanTup , I did some digging and saw that my previous branches/ releases don't have
dependencies: flutter: sdk: flutter
and we were able to continue our work till now.
So how come this issue popped up suddenly?
So how come this issue popped up suddenly?
It's because in the latest update the check for flutter
was made more strict. It used to be a simple string check which had false positives (such as when the flutter
reference was commented out). It's now working as it really always should have.
If you have the depend_on_referenced_packages lint enabled I would expect that it should have alerted you to this issue. If you don't, I would recommend enabling it (it's in the core, recommended and flutter lint sets).
Hope this makes sense!
Describe the bug VS code not able to recognize my project as a Flutter project and instead runs as a Dart project. There have been no changes in any config files or pubspec files.
To Reproduce Steps to reproduce the behavior:
Expected behavior The project should run normally as a Flutter project.
Screenshots dart code startup log(Line 212 mentions that this project is not recognized as a Flutter project) -![image](https://github.com/Dart-Code/Dart-Code/assets/54407840/237deb3f-b76d-42db-9b9f-14fb1b11c32f)
Please complete the following information:
Flutter doctor output -
Pubspec.yaml file -