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) {} }