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

后端 未结 29 955
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:13

    Add dependencies. for example:- import 'package:audioplayers/audio_cache.dart'; in the above package if we only use this package then it shows error but if we add dependencies in pubspec.yaml such as

    dependencies:
        flutter:
          sdk: flutter
        cupertino_icons: ^0.1.2
        audioplayers: ^0.14.1
    

    enter image description here

    then click on packages get.

    as you see this, I can also insert dependencies so if you insert dependencies along with your package then you are good to go.

提交回复
热议问题