Is there a standard Dart-way of making sure that all fields of a class are present in a constructor parameter list?
A very simplified example:
class Message{
String header;
String body;
DateTime sentAt;
Message(this.header, this.body, this.sentAt);
Message makeCopy(){
return Message(header, body, sentAt);
}
}
Now, a colleague comes along and adds the field String category
, but forgets to add it to the constructor - and even worse, to the copy constructor. Is there a way to make the IDE (IntelliJ) issue a warning or error about this missing new field?
I'm thinking something similar to the warning issued when omitting an enum value from a switch
-statement.
Or is there at least some way to make IntelliJ issue such a warning?