It is option to declare within the class. All class have own constructor but if we don’t declare or forget then Dart compiler will create default constructor automatically by passing the default value to the member variable.
Read moreWhat is Dart constructor?
Dart Constructors A constructor is a special function of the class that is responsible for initializing the variables of the class . Dart defines a constructor with the same name as that of the class.
Read more