invalid_ deprecated_ extend_ annotation
Details about the 'invalid_deprecated_extend_annotation' diagnostic produced by the Dart analyzer.
The annotation '@Deprecated.extend' can only be applied to extendable classes.
Description
#
The analyzer produces this diagnostic when the
@Deprecated.extend annotation is applied to a
declaration that isn't an extendable class. An extendable
class is one that isn't declared with the
interface, final, 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.extend()
sealed class C {}
Common fixes
#Remove the annotation:
sealed class C {}
除非另有说明,文档之所提及适用于 Dart 3.12.2 版本报告页面问题.