okIf static method

Result okIf(
  1. bool verify(),
  2. String reason
)

Implementation

// ignore: prefer_constructors_over_static_methods
static Result okIf(bool Function() verify, String reason) {
  if (!verify()) {
    return ResultConfig.exceptionHandler(reason, null);
  }

  return Result.ok;
}