ContractViolationError class final

An error raised when a contract check fails in ContractCheckingMode.alwaysThrow.

Inheritance

Constructors

ContractViolationError({required ViolationKind kind, required String message})
Creates an error for a failed kind with the specified message.

Properties

hashCode → int
The hash code for this object.
no setterinherited
kind → ViolationKind
The contract check that failed.
final
message → String
A description of the violation.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
stackTrace → StackTrace?
The stack trace at the point where this error was first thrown.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
Returns a description containing the failed contract kind and message.
override

Operators

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