Dart Analyze logoDart Analyze/
DRT-W1668

Undefined or inaccessible methodDRT-W1668

Major severityMajor
Bug Risk categoryBug Risk

The analyzer produces this diagnostic when it encounters an identifier that appears to be the name of a method but either isn't defined or isn't visible in the scope in which it's being referenced.

Example

The following code produces this diagnostic because the identifier removeMiddle isn't defined:

int f(List<int> l) => l.removeMiddle();

Common fixes

If the identifier isn't defined, then either define it or replace it with the name of a method that is defined. The example above can be corrected by fixing the spelling of the method:

int f(List<int> l) => l.removeLast();