values method
Retrieves the values for a key, possibly multiple values.
Returns a list of values for the key. If there are no values an empty list is returned.
By default, all values (if any) are trimmed of whitespace from both ends.
If raw
is true, the values are not trimmed.
Implementation
List<String> values(String key, {bool raw = false}) {
assert(key != null);
final values = _data[key];
if (values == null) {
// Return empty list
return <String>[];
} else if (raw) {
// Return list of raw values
return values;
} else {
// Return list of trimmed values
final x = values.map(_sanitize);
return new List<String>.from(x);
}
}