1 Code does not associate
After the VSD configuration of Dart is successful, create a new .dart file directly, and the code is not associative, and it feels bad instantly
有一个警告:For full Dart language support, please open a folder containing your Dart files instead of individual loose files
Well, it turns out that it is not supported to create a new .dart file directly for editing. You need to create a new folder, and then create a new .dart file in it.
Just open any disk, create a new folder, open it with VSD, and create a new .dart file.
2 What does assert not execute and debug mode mean
Assert says that it will be executed in debug mode. What does debug mode mean, it means that you debug is in debug mode
How to debug VisualStudioCode: Run —> 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.
That is to say, there is a launch.json file under .vscode, and the corresponding program in the file cannot be found
Then it's OK.
In debug mode, assert will be executed, if it returns false, an error will be reported directly
3 with error
错误: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 里面的构造函数删除 就可以了
}