provide_deprecation_message
Missing a deprecation message.
Description
#The analyzer produces this diagnostic when a deprecated
annotation is used instead of the Deprecated
annotation.
Example
#The following code produces this diagnostic because the function f
is annotated with deprecated
:
dart
@deprecated
void f() {}
Common fixes
#Convert the code to use the longer form:
dart
@Deprecated('Use g instead. Will be removed in 4.0.0.')
void f() {}
Was this page's content helpful?
Thank you for your feedback!
Provide details Thank you for your feedback! Please let us know what we can do to improve.
Provide details Unless stated otherwise, the documentation on this site reflects Dart 3.8.1. Page last updated on 2025-05-08. View source or report an issue.