encodeCollectionQueryParameter<T> function
ListParam<Object?>
encodeCollectionQueryParameter<T>(
- Serializers serializers,
- dynamic value,
- FullType type, {
- ListFormat format = ListFormat.multi,
Implementation
ListParam<Object?> encodeCollectionQueryParameter<T>(
Serializers serializers,
dynamic value,
FullType type, {
ListFormat format = ListFormat.multi,
}) {
final serialized = serializers.serialize(
value as Object,
specifiedType: type,
);
if (value is BuiltList<T> || value is BuiltSet<T>) {
return ListParam(List.of((serialized as Iterable<Object?>).cast()), format);
}
throw ArgumentError('Invalid value passed to encodeCollectionQueryParameter');
}