Result<T>.invalid constructor
- T value, {
- List<
Expectation> ? expectations, - Expectation? expectation,
Implementation
Result.invalid(this.value, {List<Expectation>? expectations, Expectation? expectation})
: assert(
(expectation != null || (expectations != null && expectations.isNotEmpty)),
"If invalid, either 'expectation' or a non-empty 'expectations' list must be provided",
),
isValid = false,
expectations = (expectations != null
? List.unmodifiable(expectations)
: List.unmodifiable([expectation!]));