-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: 995 - support of the new "product type" filter for "get product" (
#1004) * feat: 995 - support of the new "product type" filter for "get product" New file: * `product_type_filter.dart`: Filter on product type for API get product queries. Impacted files * `api_not_food_get_product_test.dart`: now testing only in v3 with all product type filters * `old_product_result.dart`: deprecated class `OldProductResult` * `open_food_api_client.dart`: deprecated method `getOldProduct` * `openfoodfacts.dart`: export new file `product_type_filter.dart` * `product_query_configurations.dart`: "product_type_filter" as new optional "get product" parameter; minor refactoring * minor fix cf. openfoodfacts/openfoodfacts-server#11069
- Loading branch information
1 parent
7a9c761
commit 032a547
Showing
7 changed files
with
117 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import 'off_tagged.dart'; | ||
import 'product_type.dart'; | ||
|
||
/// Filter on product type for API get product queries. | ||
class ProductTypeFilter implements OffTagged { | ||
const ProductTypeFilter._(this.offTag); | ||
|
||
ProductTypeFilter(final ProductType productType) | ||
: offTag = productType.offTag; | ||
|
||
static const ProductTypeFilter all = ProductTypeFilter._('all'); | ||
|
||
@override | ||
final String offTag; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters