Visual Studio Code - Target of URI doesn't exist 'package:flutter/material.dart'

后端 未结 29 958
Happy的楠姐
Happy的楠姐 2020-12-07 21:33

I\'ve just setup my Macbook for flutter development,

So I downloaded flutter sdk, and placed it in my Documents. After, I setup my path variable to

29条回答
  •  不知归路
    2020-12-07 22:15

    Author of the Dart Code plugin here! From the screenshot, I would say this is because your flutter project is in a sub-folder of the folder open in Code. We only scan the opened-folder to check whether it's a Flutter project - which then changes the SDK we launch and also enables the Flutter functionality (like the daemon and debugger).

    You should re-open the "todo" folder directly.

    If you want to have multiple projects open together, use multi-root workspaces, since Dart Code is multi-root-aware and will check each of the folders in the workspace when deciding if it needs to enable Flutter functionality.

    Update

    This case should be better supported in the Dart plugin now, so opening the immediate parent folder of a Flutter project should work as expected.

提交回复
热议问题