UriExtensions extension
Helpers for checking and building Uri values.
final api = Uri.parse('https://example.com/v1');
api.appendPath(['users', '42']); // https://example.com/v1/users/42
api.withQueryParameter('page', '2'); // https://example.com/v1?page=2
api.isSecure; // true
- on
Properties
- isHttp → bool
-
Available on Uri, provided by the UriExtensions extension
Whether this is anhttporhttpsaddress.no setter - isSecure → bool
-
Available on Uri, provided by the UriExtensions extension
Whether this uses an encrypted scheme (httpsorwss).no setter - lastSegment → String?
-
Available on Uri, provided by the UriExtensions extension
The last non-empty part of the path, or null if there isn't one.no setter
Methods
-
appendPath(
List< String> segments) → Uri -
Available on Uri, provided by the UriExtensions extension
A copy withsegmentsadded to the end of the path. -
withoutQueryParameter(
String key) → Uri -
Available on Uri, provided by the UriExtensions extension
A copy without the query parameterkey. -
withQueryParameter(
String key, String value) → Uri -
Available on Uri, provided by the UriExtensions extension
A copy with the query parameterkeyset tovalue.