extra_ positional_ arguments
Details about the 'extra_positional_arguments' diagnostic produced by the Dart analyzer.
Too many positional arguments: {0} expected, but {1} found.
Description
#The analyzer produces this diagnostic when a method or function invocation has more positional arguments than the method or function allows.
Example
#
The following code produces this diagnostic because f defines 2
parameters but is invoked with 3 arguments:
void f(int a, int b) {}
void g() {
f(1, 2, 3);
}
Common fixes
#Remove the arguments that don't correspond to parameters:
void f(int a, int b) {}
void g() {
f(1, 2);
}
Unless stated otherwise, the documentation on this site reflects Dart 3.10.3. Report an issue.