Preconditions class

Argument and state checks that throw when they fail.

Constructors

Preconditions()
Not needed: every member of Preconditions is static.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

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

Static Methods

checkArgument(bool condition, String errorMessage) → void
Ensures the truth of an expression involving one or more parameters to the calling method.
checkNotEmpty(String? value, String message) → String
Returns value, or throws an ArgumentError with message if it is null or empty.
checkNotNull<T>(T? object, [String? message]) → T
Returns object, or throws an ArgumentError if it is null.
checkState(bool condition, Object? message) → void
Throws a StateError with message unless condition holds.