avoid-duplicate-constant-values
Warns when a class or enum declaration has several constants with the same primitive values.
Duplicate enum constants are usually the result of a typo and a sign of a bug.
⚙️ Config
Set allowed
(default is [-1, 0, 1]
) to configure the list of allowed constants.
analysis_options.yaml
dart_code_metrics:
rules:
- avoid-duplicate-constant-values:
allowed: [1, "value"]