required top-level constant Null safety
Used to annotate a named parameter p in a method or function f.
Indicates that every invocation of f must include an argument
corresponding to p, despite the fact that p would otherwise be an
optional parameter.
Tools, such as the analyzer, can provide feedback if
- the annotation is associated with anything other than a named parameter,
- the annotation is associated with a named parameter in a method
m1that overrides a methodm0andm0defines a named parameter with the same name that does not have this annotation, or - an invocation of a method or function does not include an argument corresponding to a named parameter that has this annotation.
Implementation
const Required required = Required();