Creates error containing the invalid value.
A message is built by suffixing the message argument with the name argument (if provided) and the value. Example:
Invalid argument (foo): null
The name should match the argument name of the function, but if the function is a method implementing an interface, and its argument names differ from the interface, it might be more useful to use the interface method's argument name (or just rename arguments to match).
@pragma("vm:entry-point")
ArgumentError.value(value, [this.name, this.message])
: invalidValue = value,
_hasValue = true;
© 2012 the Dart project authors
Licensed under the BSD 3-Clause "New" or "Revised" License.
https://api.dart.dev/stable/2.18.5/dart-core/ArgumentError/ArgumentError.value.html