Error: default constructor is already defined
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) {}
}
or define a
as optional and keep only one constructor :
class FirstClass {
FirstClass([a]) {}
}