readPickles method

List<Pickle> readPickles(
  1. String key, {
  2. List<Pickle>? defaultValue,
})

Reads a List of Pickles from this Pickle.

This will throw ArgumentError if the key is empty and no default value has been provided or PickleTypeError if the associated value is of a different type than expected.

Implementation

List<Pickle> readPickles(final String key,
    {final List<Pickle>? defaultValue}) {
  try {
    return _readList(key).map(_from).toList();
  } catch (error) {
    if (defaultValue != null) {
      return defaultValue;
    }
    rethrow;
  }
}