Possible class

Denotes that an annotated element may return the given error codes or throw the given exceptions.

Error codes:

enum HttpCode { notFound }

@Possible({HttpCode.notFound})
HttpCode? foo() => HttpCode.notFound;

Exceptions:

@Possible({ArgumentError})
void foo() => throw ArgumentError();
Annotations
  • @sealed

Constructors

Possible(Set<Object> states)
Creates a Possible.
const

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
states Set<Object>
The possible exceptions or error codes.
final

Methods

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

Operators

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