Skip to content

Commit

Permalink
fix: 5570 - no nutriscore ecoscore for non-food products (#5629)
Browse files Browse the repository at this point in the history
Impacted files:
* `product_incomplete_card.dart`: minor padding fix
* `smooth_product_card_found.dart`: no display of "incomplete product button" for non-food products
  • Loading branch information
monsieurtanuki authored Sep 27, 2024
1 parent 72056fc commit 50a64f8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,13 @@ class SmoothProductCardFound extends StatelessWidget {
padding:
EdgeInsetsDirectional.only(start: VERY_SMALL_SPACE),
),
Padding(
padding: const EdgeInsets.all(VERY_SMALL_SPACE),
child: Column(
children: scores,
if (scores.isNotEmpty)
Padding(
padding: const EdgeInsets.all(VERY_SMALL_SPACE),
child: Column(
children: scores,
),
),
),
],
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ class ProductIncompleteCard extends StatelessWidget {
final bool isLoggedInMandatory;

static bool isProductIncomplete(final Product product) {
if (product.productType != null &&
product.productType != ProductType.food) {
return false;
}
bool checkScores = true;
if (_isNutriscoreNotApplicable(product)) {
AnalyticsHelper.trackEvent(
Expand Down

0 comments on commit 50a64f8

Please sign in to comment.