Target of URI doesn't exist 'package:flutter/material.dart'
I've just set up my Macbook for flutter development,
So I downloaded flutter SDK, and placed it in my Documents. After, I set up my path variable to work with flutter in my command line.
I execute the command flutter create todolist so I achieve a blank project.
I also set up my visual studio code with Dart-Code so I have the proper syntax highlight, IntelliSense, etc.
So when I open visual studio code, it highlights the import method, like the following image:
This means that it also highlights the classes that are correct, making it completely hard to understand if it's a real error or not.
I have executed both pub get and flutter packages get and got everything correctly. I have my path variables all correctly.
Why is it highlighting it cannot find that 'import' package?
androidflutterdartvisual-studio-codeflutter-packages
Follow
37.4k17
17 gold badges
201
201 silver badges
182
182 bronze badges
asked Jul 4, 2017 at 15:25
3,0663
3 gold badges
19
19 silver badges
33
33 bronze badges
What does the status bar say about the Dart version? See also github.com/Dart-Code/Dart-Code/issues/318. See also github.com/Dart-Code/Dart-Code/issues/… – Günter Zöchbauer Jul 4, 2017 at 15:35
It's correct, it says "Dart - 1.24.0-dev.6.7" @GünterZöchbauer – James Jul 4, 2017 at 15:49
But if I go to my flutter project and execute flutter run it installs properly on my device – James Jul 4, 2017 at 15:56
Do you have a non-Flutter Dart SDK installed? – Günter Zöchbauer Jul 4, 2017 at 15:57
6
Got this same issue but with Android Studio, restarting AS fixes it. – mbwasi Feb 28, 2018 at 20:39
Report this ad
36 Answers
Sorted by:
Highest score (default) Date modified (newest first) Date created (oldest first)
1
416
Restarting Visual Studio Code after
resolved the error messages for me (previously flutter pub get)
source: https://flutter.dev/docs/development/packages-and-plugins/using-packages
沒有留言:
發佈留言