The string "httpswwwmywebsiteit"
is a valid URI Reference (according to RFC 3986).
It's a relative-part with a path-noscheme which is just a single URI path segment.
If you want to validate that something is a valid URI, and has a scheme and path, you need to check for that.
if (!primaUrl.hasScheme || !primarUrl.hasAuthority || primaUrl.path.isEmpty) {
// Or whichever requirements you have on the URI.
throw ArgumentError.value(baseUrl, "baseUrl", "Not a full URI");
}
Checking whether the scheme is valid requires you to define what that means, then you can check that primaUrl.scheme
satisfies that.