annotate_overrides

Group: style

Maturity: stable

Dart SDK: >= 2.0.0 • (Linter v0.1.11)

Since info is static, may be stale
pedantic

View all Lint Rules

Using the Linter

DO annotate overridden methods and fields.

This practice improves code readability and helps protect against unintentionally overriding superclass members.

GOOD:

abstract class Dog {
  String get breed;
  void bark() {}
}

class Husky extends Dog {
  @override
  final String breed = 'Husky';
  @override
  void bark() {}
}

BAD:

class Cat {
  int get lives => 9;
}

class Lucky extends Cat {
  final int lives = 14;
}