> ## Documentation Index
> Fetch the complete documentation index at: https://docs.syntblaze.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Dart Deprecated Annotation

The `@Deprecated` annotation is a built-in metadata marker in Dart used to identify declarations (classes, functions, variables, or parameters) that are obsolete and slated for future removal. Applying this annotation instructs the Dart analyzer to emit a static warning (`deprecated_member_use`) whenever the marked element is referenced. While it does not alter the executable instructions or runtime behavior of the code, the metadata is preserved during compilation into the Dart Kernel.

Dart provides two forms of this annotation, both defined in the `dart:core` library:

**1. Parameterized `@Deprecated` (Preferred)**
This form invokes the `Deprecated` class constructor, accepting a single positional `String` argument. The string is surfaced directly in the IDE or compiler warnings, providing developers with migration instructions or versioning details.

```dart theme={"dark"}
@Deprecated('Use newMethod() instead. Will be removed in v2.0.0.')
void oldMethod() {
  // Implementation
}
```

**2. Constant `@deprecated` (Legacy)**
This is a lowercased, unparameterized constant instance of the `Deprecated` class, defined internally as `const Deprecated("next release")`. It provides a generic warning without specific migration guidance.

```dart theme={"dark"}
@deprecated
String legacyVariable = 'data';
```

## Technical Characteristics

* **Target Scope:** The annotation can be applied to almost any Dart declaration, including `class`, `mixin`, `extension`, `typedef`, `method`, `getter`, `setter`, `variable`, and `parameter`.
* **Compilation and AST:** During parsing, the annotation modifies the Abstract Syntax Tree (AST) by adding an `Annotation` node to the targeted declaration. This metadata is retained in the compiled Dart Kernel (`.dill` files) and can be accessed programmatically via reflection (`dart:mirrors`) or macro builders.
* **Inheritance Behavior:** Deprecation is not strictly transitive. Overriding a `@Deprecated` method in a subclass does not automatically apply the `@Deprecated` metadata to the subclass's method, though the analyzer will flag the override itself as a usage of a deprecated member.
* **Linting:** The Dart linter enforces the use of the parameterized version over the unparameterized constant via the `provide_deprecation_message` lint rule.

<div
  style={{ 
display: "flex", 
justifyContent: "space-between", 
alignItems: "center", 
maxWidth: "754px", 
padding: "1rem 0",
marginBottom: "24px"
}}
>
  <span style={{ fontWeight: "bold", fontSize: "1.25rem", color: "var(--tw-prose-headings)", fontFamily: "Inter, ui-sans-serif, system-ui, sans-serif" }}>Tired of Poor Dart Skills? Fix That With Deep Grasping!</span>

  <a
    href="https://syntblaze.com"
    target="_blank"
    style={{ 
  marginLeft: "24px",
  textDecoration: "none", 
  backgroundColor: "#007AFF",
  color: "#ffffff", 
  padding: "6px 16px", 
  borderRadius: "16px",
  fontSize: "0.9rem",
  fontWeight: "600",
  textAlign: "center",
  transition: "background-color 0.2s ease"
}}
  >
    Learn More
  </a>
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/skill-tracking.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=b9b0305c93bb501c9e767b5c76c88835" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/skill-tracking.png" />

  <img src="https://mintcdn.com/syntblazellc/23tyuOzaWS88qFlc/images/nuggets.png?fit=max&auto=format&n=23tyuOzaWS88qFlc&q=85&s=c86c80197299762989e9b882419b2109" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/nuggets.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/bite-sized-exercises.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=a65f9a38c37ff28ab73ed783c53c60e3" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/bite-sized-exercises.png" />
</div>

<div style={{ display: "flex", gap: "12px", flexWrap: "wrap", marginTop: "12px" }}>
  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/mastery-chain.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=748a1763454713e679260fbb95f154a2" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/mastery-chain.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-previews.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=242f61448ff5dd6deaaab2dccc13b507" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-previews.png" />

  <img src="https://mintcdn.com/syntblazellc/-L0ums_2lctDSZ1l/images/element-explanations.png?fit=max&auto=format&n=-L0ums_2lctDSZ1l&q=85&s=cf0fc1c31f9cd0fc26716781be05fbc9" style={{ width: "30%", minWidth: 60 }} width="621" height="1344" data-path="images/element-explanations.png" />
</div>
