Url class

Immutable URL, thin wrapper over Uri with httpx-style ergonomics.

  • scheme/host are lowercased; the port is null for the scheme's default (so :80 on http reads as "no port", matching the httpx Url).
  • copyWith produces a new Url without mutating the original.
  • join does RFC 3986 §5.3 reference resolution (Uri.resolve).
  • toString masks 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?
null when 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 ref against 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