Answers for "dart he default constructor is already defined. Try giving one of the constructors a name."

0

dart he default constructor is already defined. Try giving one of the constructors a name.

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) {}
}
Posted by: Guest on August-06-2020

Code answers related to "dart he default constructor is already defined. Try giving one of the constructors a name."

Code answers related to "Dart"

Browse Popular Code Answers by Language