remove_ deprecations_ in_ breaking_ versions
                  Remove deprecated elements in breaking versions.
Description
#
                    The analyzer produces this diagnostic in packages that have a "breaking"
                    version number (x.0.0 or 0.x.0) for every declaration that has a
                    @Deprecated annotation.
                  
Example
#Given a package with a pubspec.yaml file containing:
name: p
version: 2.0.0
environment:
  sdk: ^3.9.0
                      
                      
                      
                    
                    The following code produces this diagnostic because the function f is
                    annotated with @deprecated:
                  
@deprecated
void f() {}
void g() {}
                      
                      
                      
                    Common fixes
#- If the declaration should be removed in the next release of the package, then remove the declaration:
 
void g() {}
                      
                      
                      
                    - If you are not making a breaking change, then use a minor or patch version increment for the package:
 
name: p
version: 1.0.1
environment:
  sdk: ^3.9.0
                      
                      
                      
                    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.