remove method
void
remove(
- String key,
- String value, {
- @Deprecated('use mode: ParamsMode.raw') bool raw = false,
- ParamsMode mode = ParamsMode.standard,
Remove a particular value associated with a key.
For the key
all values that match value
are removed.
The mode
determines how values are processed before it is compared
for a match. It defaults to ParamsMode.standard.
For example, if values for the key are
[ "a b", "a b ", "a\nb" ]
,
the value being removed is "a b"
and the mode is:
- ParamsMode.standard, all values are removed;
- ParamsMode.rawLines, the first and second values are removed;
- ParamsMode.raw, only the first value is removed.
If the deprecated raw
parameter is set to true, it is the same as using
the ParamsMode.raw mode. It is being replaced by the mode
parameter, which gives greater flexibility to this method.
Do not use both raw and mode.
Implementation
void remove(String key, String value,
{@Deprecated('use mode: ParamsMode.raw') bool raw = false,
ParamsMode mode = ParamsMode.standard}) {
// When the deprecated "raw" parameter is removed, delete the next few lines
// and just use the "mode".
assert(
!raw || raw && mode == ParamsMode.standard, 'do not mix raw with mode');
final _realMode = raw ? ParamsMode.raw : mode;
_remove(key, value, _realMode);
}