undefined_ getter
The getter '{0}' isn't defined for the '{1}' function type.
The getter '{0}' isn't defined for the type '{1}'.
Description
#The analyzer produces this diagnostic when it encounters an identifier that appears to be the name of a getter 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
String
has no member
named
len
:
int f(String s) => s.len;
Common fixes
#If the identifier isn't defined, then either define it or replace it with the name of a getter that is defined. The example above can be corrected by fixing the spelling of the getter:
int f(String s) => s.length;
Unless stated otherwise, the documentation on this site reflects Dart 3.9.2. Page last updated on 2025-9-1. View source or report an issue.