VisualStudioCode VSD 集成Dart 采坑记录

1  代码不联想

VSD配置Dart都成功以后,直接新建一个 .dart 文件,结果代码不联想,瞬间感觉不好了

有一个警告:For full Dart language support, please open a folder containing your Dart files instead of individual loose files

好吧,原来是直接新建一个 .dart 文件进行编辑不支持,需要新建一个文件夹,再在里面新建  .dart文件就可以了

就是打开随便哪个盘,新建一个文件夹,用VSD打开,再新建  .dart文件就可以了

2 assert不执行 及调试模式啥意思

assert说在调试模式下才会执行,调试模式啥意思呢,就是你debug就是调试模式

VisualStudioCode怎么debug呢: 运行 —> 调试  

然后报错: Your launch config references a program that does not exist. If you have problems launching, check the "program" field in your ".vscode/launch.json" file.

就是说在 .vscode下面有一个 launch.json 的文件,文件里面program对应的东西找不到

 

然后就OK 了。

debug模式下,assert就会执行,如果返回false会直接报错

3 with 报错  

错误:The class 'B' can't be used as a mixin because it declares a constructor.dart(mixin_class_declares_constructor)

class A{

    A(){
            
         }    



}

class B with A{
    
    //  此时会报错:
    //  The class 'B' can't be used as a mixin because it declares a         
    //  constructor.dart(mixin_class_declares_constructor)
    //  就是 说A无法作为一个mixin 因为他有构造函数
    // 把类A 里面的构造函数删除 就可以了

}

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值