📜  dart 已经定义了默认构造函数.尝试为其中一个构造函数命名. - 飞镖代码示例

📅  最后修改于: 2022-03-11 14:48:08.327000             🧑  作者: Mango

代码示例1
In dart you can not have the same method/constructor name used several times 
(even with different parameters).

In your case you can either use named constructor to define 2 constructors :

class FirstClass {
  FirstClass() {}
  FirstClass.withA(a) {}
}