UseResult class Null safety

See useResult for more details.

Annotations
  • @Target({TargetKind.field, TargetKind.function, TargetKind.getter, TargetKind.method, TargetKind.topLevelVariable})

Constructors

UseResult([String reason = ''])
Initialize a newly created instance to have the given reason.
const
UseResult.unless({required String? parameterDefined, 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.
const

Properties

hashCode int
The hash code for this object.
read-onlyinherited
parameterDefined String?
Names a parameter of a method or function that, when present, signals that the annotated member's value is used by that method or function and does not need to be further checked.
final
reason String
A human-readable explanation of the reason why the value returned by accessing this member should be used.
final
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited