File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
packages/smooth_app/lib/knowledge_panel/knowledge_panels Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -88,7 +88,7 @@ class KnowledgePanelActionCard extends StatelessWidget {
8888 'https://nutripatrol.openfoodfacts.org/flag/product/'
8989 '?barcode=${product .barcode }'
9090 '&source=mobile'
91- '&flavor=${product .productType ?.offTag }' ,
91+ '&flavor=${product .productType ?.flavor . offTag }' ,
9292 ),
9393 );
9494 }
@@ -143,3 +143,13 @@ class KnowledgePanelActionCard extends StatelessWidget {
143143 properties.add (IterableProperty <String >('actions' , element.actions));
144144 }
145145}
146+
147+ // TODO(monsieurtanuki): move code to off-dart
148+ extension ProductTypeFlavorExtension on ProductType {
149+ Flavor get flavor => switch (this ) {
150+ ProductType .food => Flavor .openFoodFacts,
151+ ProductType .beauty => Flavor .openBeautyFacts,
152+ ProductType .petFood => Flavor .openPetFoodFacts,
153+ ProductType .product => Flavor .openProductFacts,
154+ };
155+ }
You can’t perform that action at this time.
0 commit comments