0PricingLogin
Dart Academy · Lesson

Built-in Annotations: override, deprecated

Signal intent to tools and teammates.

What Annotations Are

An annotation is metadata you attach to code with an @ symbol. It does not run; it informs tools, the analyzer, and your teammates. 🏷️

The @ Syntax

You place an annotation on the line right before a declaration. The @ prefix tells Dart this token is metadata, not a normal expression.

@override
String toString() => 'Cat';

All lessons in this course

  1. Built-in Annotations: override, deprecated
  2. Writing Custom Annotations
  3. Code Generation With build_runner
  4. json_serializable in Action
← Back to Dart Academy