Reputation: 347
In most Dart documentation pages, some variables and functions are crossed out. like in https://api.dartlang.org/1.14.2/dart-js/dart-js-library.html
What does this signify?
Upvotes: 2
Views: 146
Reputation: 4013
It signifies that the class, function, property etc. is deprecated
In Dart, annotations are used to mark something as deprecated. Notice the documented annotation on this class.
Upvotes: 2
Reputation: 657937
In Dart metadata can be added to classes, fields, library declaratoins, parameters, ... as annotation.
@Deprecated('some reason')
class SomeClass {
String someField;
int otherField;
SomeClass({
this.someField,
@Deprecated('don\'t use this anymore") this.otherField});
}
is such an annotation and some tools like the Dart analyzer and dartdoc use this information to produce warnings (Analyzer) or other visual cues that some API still exists but should be avoided because it's planned to be removed eventually.
Upvotes: 3