isOk property

bool get isOk

Returns true if this result is a success (Ok).

Use this for conditional logic checking if an operation succeeded. For checking whether a value matches a condition, use isOkAnd instead.

Example:

if (result.isOk) {
  print('Operation succeeded');
}

Implementation

bool get isOk => this is Ok<T, E>;