Flutter: Run the new project error

 Today, the customer took over a pass over the Flutter project, estimated to be copied directly to the customer, and can not be run directly, because the first took Flutter, a lot of things still do not know, somehow give a toss.

1. 提示Dart SDK is not configured.

 Click on the top right corner of the "Open Dart settings" prompt, or click on "File" on the menu bar - "Settings" - "Languages ​​& Frameworks" - "Flutter" section, set the position Flutter SDK is located.

Set location Good Flutter SDK is located, click OK to save (I was in D: \ under the flutter-sdk "directory). After the directory Dart SDK of the above without setting, click OK to set good location Flutter SDK is located, IDE will automatically Looking to the location of Dart SDK is located.

2. set up open files in the lib directory, still found error

This shows that still can not find the location where the Dart SDK, you can check in the project directory  .packages  file to see if misconfigured.

 

(File still prompt an error)

SDK path (.packages) file definition is wrong.

This time .packages can delete files in the project directory, and then open the next project directory  pubspec.yaml  file, click "Packages get" button above the text, wait a moment, the project will be re-configured, open dart lib directory again file,

 

Guess you like

Origin www.cnblogs.com/yongdaimi/p/11504609.html