attemptParse static method

Result<Uri> attemptParse(
  1. String uri
)

Implementation

static Result<Uri> attemptParse(String uri) {
  final u = Uri.tryParse(uri);
  if (u == null) {
    return Result.failure(UriFailures.parseFailure, 'Invalid URI');
  } else {
    return Result.success(u);
  }
}