UriExtensions extension

Extension methods for URI manipulation.

on

Properties

fileExtension String?

Available on Uri, provided by the UriExtensions extension

Returns the file extension from this URI path, or null if none exists. Audited: 2026-06-12 11:26 EDT
no setter
fileName String?

Available on Uri, provided by the UriExtensions extension

Returns the file name from this URI path, or null if the path is empty. Audited: 2026-06-12 11:26 EDT
no setter
isImageUri bool

Available on Uri, provided by the UriExtensions extension

Returns true if this URI points to an image file.
no setter
isSecure bool

Available on Uri, provided by the UriExtensions extension

Returns true if this URI uses HTTPS scheme.
no setter

Methods

addQueryParameter(String key, String? value) Uri

Available on Uri, provided by the UriExtensions extension

Returns a new URI with the key query parameter set to value.
getQueryParameter(String key) String?

Available on Uri, provided by the UriExtensions extension

Returns the value of the key query parameter, or null if not found.
hasQueryParameter(String key) bool

Available on Uri, provided by the UriExtensions extension

Returns true if this URI has a query parameter named key.
removeQuery({bool removeFragment = true}) Uri

Available on Uri, provided by the UriExtensions extension

Returns a new URI with query parameters removed.
replaceHost(String newHost) Uri

Available on Uri, provided by the UriExtensions extension

Returns a new URI with the host replaced by newHost, or this URI if newHost is empty.