buildEverythingUrl static method
String
buildEverythingUrl(
- String? query,
- String? queryInTitle,
- String? sources,
- String? domains,
- String? excludeDomains,
- DateTime? from,
- DateTime? to,
- String? language,
- String? sortBy,
- int? pageSize,
- int? page,
)
Implementation
static String buildEverythingUrl(
String? query,
String? queryInTitle,
String? sources,
String? domains,
String? excludeDomains,
DateTime? from,
DateTime? to,
String? language,
String? sortBy,
int? pageSize,
int? page,
) {
final Uri url = Uri.parse("everything?x=y");
final queryParams = <String, String>{};
if (query != null) queryParams["q"] = query;
if (queryInTitle != null) queryParams["qInTitle"] = queryInTitle;
if (sources != null) queryParams["sources"] = sources;
if (domains != null) queryParams["domains"] = domains;
if (excludeDomains != null) queryParams["excludeDomains"] = excludeDomains;
if (from != null) queryParams["from"] = Util.formatDate(from);
if (to != null) queryParams["to"] = Util.formatDate(to);
if (language != null) queryParams["language"] = language;
if (sortBy != null) queryParams["sortBy"] = sortBy;
if (pageSize != null) queryParams["pageSize"] = pageSize.toString();
if (page != null) queryParams["page"] = page.toString();
return url.replace(queryParameters: queryParams).toString();
}