provide_deprecation_message

Group: style

Maturity: stable

Linter v0.1.82

Since info is static, may be stale
corerecommendedflutter

View all Lint Rules

Using the Linter

DO specify a deprecation message (with migration instructions and/or a removal schedule) in the Deprecation constructor.

BAD:

@deprecated
void oldFunction(arg1, arg2) {}

GOOD:

@Deprecated("""
[oldFunction] is being deprecated in favor of [newFunction] (with slightly
different parameters; see [newFunction] for more information). [oldFunction]
will be removed on or after the 4.0.0 release.
""")
void oldFunction(arg1, arg2) {}