decode method

DecodedSearch<S> decode(
  1. Map<String, List<String>> values
)

Decodes a URI query multimap into canonical typed state.

Implementation

DecodedSearch<S> decode(Map<String, List<String>> values) {
  final decode = _decode;
  if (decode == null) {
    throw StateError('SearchParams.schema() has not been compiled.');
  }
  final input = SearchInput(values);
  try {
    final value = decode(input);
    _validateReads(input);
    return DecodedSearch<S>(value: value, keys: _keys!);
  } on ParameterFormatException catch (error, stackTrace) {
    _validateReads(input);
    if (invalid == InvalidSearchBehavior.error) {
      Error.throwWithStackTrace(
        SearchParameterFormatException._(error),
        stackTrace,
      );
    }
    return DecodedSearch<S>(value: defaults, keys: _keys!, error: error);
  }
}