removeQueryParam method

Uri removeQueryParam(
  1. String key
)

Returns a new Uri with key removed from the query string.

Uri.parse('https://example.com?page=1&q=dart').removeQueryParam('q')
// https://example.com?page=1

Implementation

Uri removeQueryParam(String key) {
  final params = Map<String, String>.from(queryParameters)..remove(key);
  return replace(queryParameters: params.isEmpty ? null : params);
}