URLSearchParams class

The URLSearchParams interface defines utility methods to work with the query string of a URL.

Constructors

URLSearchParams([dynamic init])
Returns a URLSearchParams object instance.
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
size int
Indicates the total number of search parameter entries.
no setter

Methods

append(String name, String value) → void
Appends a specified key/value pair as a new search parameter.
delete(String name, [String? value]) → void
Deletes search parameters that match a name, and optional value, from the list of all search parameters.
entries() Iterable<(String, String)>
Returns an iterator allowing iteration through all key/value pairs contained in this object in the same order as they appear in the query string.
forEach(void callback(String name, String value, URLSearchParams searchParams)) → void
Allows iteration through all values contained in this object via a callback function.
get(String name) String?
Returns the first value associated with the given search parameter.
getAll(String name) Iterable<String>
Returns all the values associated with a given search parameter.
has(String name, [String? value]) bool
Returns a boolean value indicating if a given parameter, or parameter and value pair, exists.
keys() Iterable<String>
Returns an Iterable allowing iteration through all keys of the key/value pairs contained in this object.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
set(String name, String value) → void
Sets the value associated with a given search parameter to the given value. If there are several values, the others are deleted.
sort() → void
Sorts all key/value pairs, if any, by their keys.
toString() String
Returns a string containing a query string suitable for use in a URL.
override
values() Iterable<String>
Returns an iterator allowing iteration through all values of the key/value pairs contained in this object.

Operators

operator ==(Object other) bool
The equality operator.
inherited