isValid property

bool get isValid

Returns true if this is a Valid result, false if Invalid.

Use this for conditional logic to check if validation succeeded. For pattern matching or extracting the value, use switch with Valid/Invalid or call unwrapOrNull and asResult.

Example:

if (validation.isValid) {
  final value = validation.unwrapOrNull()!; // Safe to unwrap
  processValue(value);
}

Implementation

bool get isValid => this is Valid<T>;