getProductUri static method
Uri
getProductUri(
- String barcode, {
- OpenFoodFactsLanguage? language,
- OpenFoodFactsCountry? country,
- QueryType? queryType,
- required bool replaceSubdomain,
Returns the URI to the product page on a website
If the target website supports different domains for country + language,
replaceSubdomain
should be set to true.
Implementation
static Uri getProductUri(
final String barcode, {
final OpenFoodFactsLanguage? language,
final OpenFoodFactsCountry? country,
final QueryType? queryType,
required final bool replaceSubdomain,
}) {
final Uri uri = UriHelper.getUri(
path: 'product/$barcode',
queryType: queryType,
addUserAgentParameters: false,
);
if (!replaceSubdomain) {
return uri;
}
return UriHelper.replaceSubdomain(
uri,
language: language,
country: country,
);
}