Url class
Immutable URL, thin wrapper over Uri with httpx-style ergonomics.
- scheme/host are lowercased; the port is
nullfor the scheme's default (so:80on http reads as "no port", matching the httpxUrl). copyWithproduces a new Url without mutating the original.joindoes RFC 3986 §5.3 reference resolution (Uri.resolve).toStringmasks the password in the userinfo.
ponytail: IDNA encode/decode of the host is deferred (no stdlib punycode);
rawHost currently equals the (lower-cased) parsed host.
Constructors
- Url.fromUri(Uri uri)
-
factory
- Url.parse(String url)
-
factory
Properties
- fragment → String?
-
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- host → String
-
no setter
- path → String
-
no setter
- port → int?
-
nullwhen equal to the scheme's default port.no setter - query → QueryParams
-
no setter
- rawHost → String
-
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- scheme → String
-
no setter
Methods
-
copyWith(
{String? scheme, String? host, Object? port = const _Keep(), String? path, String? fragment, QueryParams? query}) → Url -
join(
String ref) → Url -
Resolve
refagainst this URL (RFC 3986 §5.3). -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited