random method
Request<List<Photo> >
random({
- String? query,
- String? username,
- bool? featured,
- Iterable<
String> ? collections, - PhotoOrientation? orientation,
- int count = 1,
- ContentFilter? contentFilter,
Implementation
Request<List<Photo>> random({
String? query,
String? username,
bool? featured,
Iterable<String>? collections,
PhotoOrientation? orientation,
int count = 1,
ContentFilter? contentFilter,
}) {
assert(count >= 0 && count <= client.settings.maxPageSize);
final params = queryParams({
'query': query,
'username': username,
'featured': featured,
'collections': collections?.join(','),
'orientation': orientation?.let(enumName),
'count': count,
'content_filter': contentFilter?.let(enumName),
});
final url = baseUrl.resolve('random').replace(queryParameters: params);
return Request(
client: client,
httpRequest: http.Request('GET', url),
isPublicAction: true,
bodyDeserializer: _deserializePhotos,
);
}