invalid_ deprecated_ instantiate_ annotation
Details about the 'invalid_deprecated_instantiate_annotation' diagnostic produced by the Dart analyzer.
The annotation '@Deprecated.instantiate' can only be applied to classes.
Description
#
The analyzer produces this diagnostic when the @Deprecated.instantiate
annotation is applied to a declaration that isn't an instantiable class.
An instantiable class is one that isn't declared with the abstract or
sealed keywords and has at least one public, generative constructor.
Example
#The following code produces this diagnostic because the annotation is on a sealed class:
@Deprecated.instantiate()
sealed class C {}
Common fixes
#Remove the annotation:
sealed class C {}
Unless stated otherwise, the documentation on this site reflects Dart 3.10.3. Report an issue.