Result class

Represents the result of a validation.

Available extensions

Constructors

Result.new({required bool isValid, required dynamic value, Iterable<Expectation>? expectations, Expectation? expectation})
Result.invalid(dynamic value, {Iterable<Expectation>? expectations, Expectation? expectation})
Result.valid(dynamic value)

Properties

description → String?
no setter
expectationCount → int
no setter
expectations → Iterable<Expectation>
The list of expectations for the validation result. It will contain expectations independent of the validation result.
final
firstExpectation → Expectation
no setter
hasExpectations → bool
no setter
hashCode → int
The hash code for this object.
no setterinherited
isNotValid → bool
no setter
isValid → bool
final
lastExpectation → Expectation
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → dynamic
final

Methods

copyWith({bool? isValid, List<Expectation>? expectations, dynamic value}) → Result
Creates a copy of the result with the given parameters.
detailed({int maxValueLength = 120, int maxErrorsToList = 20}) → String

Available on Result, provided by the ResultFormatting extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, Object?>
toString() → String
A string representation of this object.
override

Operators

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