UseResult.unless constructor Null safety

const UseResult.unless(
  1. {required String? parameterDefined,
  2. String reason = ''}
)

Initialize a newly created instance to annotate a function or method that identifies a parameter parameterDefined that when present signals that the result is used by the annotated member and does not need to be further checked. For values that need to be used unconditionally, use the unnamed UseResult constructor, or if no reason is specified, the useResult constant.

Tools, such as the analyzer, can provide feedback if

  • a parameter named by parameterDefined is not declared by the annotated method or function.

Implementation

const UseResult.unless({required this.parameterDefined, this.reason = ''});