invalid_ deprecated_ mixin_ annotation
The annotation '@Deprecated.mixin' can only be applied to classes.
Description
#
The analyzer produces this diagnostic when the @Deprecated.mixin
annotation is applied to a declaration that isn't a mixin class.
Example
#The following code produces this diagnostic because the annotation is on a non-mixin class:
@Deprecated.mixin()
class C {}
Common fixes
#Remove the annotation:
class C {}
Unless stated otherwise, the documentation on this site reflects Dart 3.9.2. Page last updated on 2025-11-4. View source or report an issue.