no_duplicate_case_values

Group: errors

Maturity: stable

Linter v0.1.30

Since info is static, may be stale
corerecommendedflutterpedantic

View all Lint Rules

Using the Linter

DON'T use more than one case with same value.

This is usually a typo or changed value of constant.

GOOD:

const int A = 1;
switch (v) {
  case A:
  case 2:
}

BAD:

const int A = 1;
switch (v) {
  case 1:
  case 2:
  case A:
  case 2:
}