Skip to content

Commit

Permalink
Fix how to process attribute match score (openfoodfacts#627)
Browse files Browse the repository at this point in the history
* Don't show label attribute widgets when their status is unknown

* Create named arguments

* First version of displaying eco card with knowledge panels

* Pubspec changes revert

* Pubspec changes revert

* Pubspec changes revert

* Pubspec changes revert

* Comments resolution and adhere to new BE format

* Revert pubspec.yaml

* Work with nullable elements

* Fix padding

* Add a padding after Icon in Score Card (otherwise on smaller devices the text appears right next to the icon)

* Create a place for shared constants in Smoothie to go

* Merge conflicts resolution

* Add comment

* Make new_product_page responsive on multiple devices

* Update constants.dart

* Tiny

* Update sorting order

* Add some more consts

* Move ui_helpers to -> smooth_ui_library

* Format

* Some more changes

* Merge

* Merge

* Merge

* Updates to ui_helper

* Format

* Remove 'Loading..' text and fix some padding

* Remove 'Loading..' text and fix some padding

* Remove 'Loading..' text and fix some padding

* Fix how to process attribute match score

Co-authored-by: Jasmeet Singh <jasmeetsingh@google.com>
  • Loading branch information
jasmeet0817 and Jasmeet Singh authored Oct 18, 2021
1 parent ab7b863 commit 36a1d89
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/smooth_app/lib/helpers/attributes_card_helper.dart
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ AttributeEvaluation getAttributeEvaluation(Attribute attribute) {
// > 100: Unknown
final int matchGrade = (attribute.match! / 20.0).ceil();
switch (matchGrade) {
case 0 | 1:
case 0:
case 1:
return AttributeEvaluation.VERY_BAD;
case 2:
return AttributeEvaluation.BAD;
Expand Down

0 comments on commit 36a1d89

Please sign in to comment.