AbstractQueryConfiguration constructor

AbstractQueryConfiguration({
  1. OpenFoodFactsLanguage? language,
  2. List<OpenFoodFactsLanguage>? languages,
  3. OpenFoodFactsCountry? country,
  4. List<ProductField>? fields,
  5. List<Parameter> additionalParameters = const [],
})

Implementation

AbstractQueryConfiguration({
  this.language,
  this.languages,
  this.country,
  this.fields,
  this.additionalParameters = const [],
}) {
  fields ??= [ProductField.ALL];
  if (languages != null) {
    if (language != null && languages!.isNotEmpty) {
      throw ArgumentError(
          '[languages] cannot be used together with [language]');
    }
  }
}