openfoodfacts / smooth-app

🤳🥫 The new Open Food Facts mobile application for Android and iOS, crafted with Flutter and Dart
https://world.openfoodfacts.org/open-food-facts-mobile-app?utm_source=off&utf_medium=web&utm_campaign=github-repo
Apache License 2.0
831 stars 278 forks source link

Eco-Score labels input #524

Closed teolemon closed 2 years ago

teolemon commented 3 years ago

Who for

Why

Semi-blocked on

Mockup

Part of

monsieurtanuki commented 3 years ago

Anybody able to provide a list of SVG URLs?

teolemon commented 3 years ago

Yes, I added them in the design document @monsieurtanuki

teolemon commented 3 years ago

@monsieurtanuki I've added the missing logo to Product Opener. I have added what the URL will be once it's deployed.

monsieurtanuki commented 3 years ago

@teolemon I've run a simple test on label SVGs, displaying all of them on a blue background: Simulator Screen Shot - iPhone 8 Plus - 2021-08-30 at 13 03 23

When I've run the test there was no SVG available in 2 cases:

That's OK with the following SVGs:

There are some transparency/white issues with the following SVGs - a solution could be to display the labels systematically on a white background, which is unfortunately not recommended on "dark mode":

"Black shape" error for 2 SVGs:

I managed to understand the reason of the "black shapes": flutter_svg does not seem to support the CSS syntax <style type="text/css">.st0{fill:#FFFFFF;}</style><path class="st0" ...>

When you replace it with <path fill="#ffffff" ...> that works: Simulator Screen Shot - iPhone 8 Plus - 2021-08-30 at 13 34 25

Additional warning on https://world.openfoodfacts.org/images/lang/en/labels/roundtable-on-sustainable-palm-oil.90x90.svg

flutter: Warning: Flutter SVG only supports the following formats for width and height on the SVG root: width="100%" width="100px" width="100" (where the number will be treated as pixels). The supplied value (98.778mm) will be discarded and treated as if it had not been specified. flutter: Warning: Flutter SVG only supports the following formats for width and height on the SVG root: width="100%" width="100px" width="100" (where the number will be treated as pixels). The supplied value (100.05mm) will be discarded and treated as if it had not been specified.

darrenaustin commented 3 years ago

@teolemon, If no one else has started on this, I wouldn't mind taking a stab at it.

monsieurtanuki commented 3 years ago

@darrenaustin So far I've only played with the SVG files on a blue background - cf. my previous comment. Go ahead!

monsieurtanuki commented 2 years ago

I think it doesn't make sense anymore with the autocomplete text. Feel free to reopen if relevant.