prefer_const_declarations

Group: style

Maturity: stable

Linter v0.1.43

Since info is static, may be stale
flutter

View all Lint Rules

Using the Linter

PREFER using const for const declarations.

Const declarations are more hot-reload friendly and allow to use const constructors if an instantiation references this declaration.

GOOD:

const o = <int>[];

class A {
  static const o = <int>[];
}

BAD:

final o = const <int>[];

class A {
  static final o = const <int>[];
}