not_
                  1 positional argument expected by '{0}', but 0 found.
1 positional argument expected, but 0 found.
{0} positional arguments expected by '{1}', but {2} found.
{0} positional arguments expected, but {1} found.
Description
#The analyzer produces this diagnostic when a method or function invocation has fewer positional arguments than the number of required positional parameters.
Example
#
                    The following code produces this diagnostic because f declares two
                    required parameters, but only one argument is provided:
                  
void f(int a, int b) {}
void g() {
  f(0);
}
Common fixes
#Add arguments corresponding to the remaining parameters:
void f(int a, int b) {}
void g() {
  f(0, 1);
}
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.