Giter Site home page Giter Site logo

openfoodfacts / smooth-app Goto Github PK

View Code? Open in Web Editor NEW
704.0 19.0 254.0 56.19 MB

The new Open Food Facts mobile application for Android and iOS, crafted with Flutter and Dart

Home Page: https://world.openfoodfacts.org/open-food-facts-mobile-app?utm_source=off&utf_medium=web&utm_campaign=github-repo

License: Apache License 2.0

Kotlin 0.08% Swift 0.18% Objective-C 0.01% Dart 96.43% Ruby 0.44% Shell 0.47% CMake 1.05% C++ 1.29% C 0.05%
dart dartlang flutter nutrition openfoodfacts food android ios mobile-app hacktoberfest

smooth-app's Introduction


Smooth App: The new Open Food Facts mobile app for Android and iPhone

SmoothApp Post-Submit Tests Create internal releases

Weekly meetings

  • We e-meet Thursdays at 17:30 Paris Time (16:30 London Time, 22:00 IST, 08:30 AM PT)
  • Google Meet Video call link: https://meet.google.com/gnp-frks-esc
  • Join by phone: https://tel.meet/gnp-frks-esc?pin=1110549945262
  • Add the Event to your Calendar by adding the Open Food Facts community calendar to your calendar
  • Weekly Agenda: please add the Agenda items as early as you can. Make sure to check the Agenda items in advance of the meeting, so that we have the most informed discussions possible, leading to argumented decisions.
  • The meeting will handle Agenda items first, and if time permits, collaborative bug triage.
  • We strive to timebox the core of the meeting (decision making) to 30 minutes, with an optional free discussion/live debugging afterwards.
  • We take comprehensive notes in the Weekly Agenda of agenda item discussions and of decisions taken.

User interface

Feature Sprint

Code documentation

Code documentation on GitHub pages.

Current Release

  • Latest commit deployed to Apple App Store: Released on Nov 29th as Build 835
  • Latest commit deployed to PlayStore: 792 from Nov 6th 11AM

Presentation

  • This new mobile application aims to showcase Open Food Facts's power to a broad range of users through a smooth user experience and sleek user interface. It is a Flutter application by Open Food Facts.
  • We pioneered the collaborative scanning app in 2012. With this experimental app, we’re reinventing it from the ground up.
  • Install it on Android (Google Play, F-Droid or Amazon App Store) or iPhone/iPad. Note that a internal development build (Android or iPhone/iPad (App Store) if you'd like to use the results of your PRs quicker.

app showcase

  • Smooth-app is developed in parallel to the openfoodfacts-dart plugin, which provides a high level interface with the Open Food Facts API and openfoodfacts_flutter_lints which provides specific linting
  • Every new interaction with the API should be implemented in the plugin in order to provide these new features to other developers.
  • We support desktop platforms (Linux, macOS and Windows), but only for development

Features of the app

Features

  • a scan that truly matches who you are (Green: the product matches your criteria, Red: there is a problem, Gray: Help us answer you by photographing the products)
  • a product page that's knowledgeable, building on the vast amount of food facts we collect collaboratively, and other sources of knowledge, to help you make better food decisions

You can

  • scan and compare in 15 seconds the 3 brands of tomato sauces left on the shelf, on your terms.
  • get a tailored comparison of any food category
  • set your preferences without ruining your privacy

Criteria you can pick

  • Environment: Eco-Score
  • Health: Additives & Ultra processed foods, Salt, Allergens, Nutri-Score

About this Repository

GitHub language count GitHub top language GitHub last commit Github Repo Size


How to run the project

We have predefined run configurations for Android Studio and Visual Studio Code

In order to run the application, make sure you are in the packages/smooth_app directory and run these commands:

  • flutter pub get .

  • On Android 🤖: flutter run -t lib/entrypoints/android/main_google_play.dart

  • On iOS/macOS 🍎: flutter run -t lib/entrypoints/ios/main_ios.dart

  • Troubleshooting🚀: If you get an error like App depends on scanner shared from path which depends on camera_platform_interface from git, version solving failed. then run

    • flutter pub cache clean or manually delete the
    • C:\Users\~\AppData\Local\Pub\Cache file. Then redo the above procedure to run the app.
  • Contributing Guidelines


Thanks

The app was initially created by Primael. The new Open Food Facts app (smooth_app) was then made possible thanks to an initial grant by the Mozilla Foundation in February 2020, after Pierre pitched them the idea at FOSDEM. A HUGE THANKS 🧡 In addition to the core role of the community, we also had the support from several Google.org fellows and a ShareIt fellow that helped us eventually release the app in June 2022.

Contributors

List of contributors to this repository

smooth-app's People

Contributors

abhay1821 avatar abughalib avatar adiii1436 avatar akashsri3bi avatar ashaman999 avatar bhattabhi013 avatar cli1005 avatar crowdin-bot avatar dependabot[bot] avatar g123k avatar github-actions[bot] avatar gowthamgoush avatar gspencergoog avatar jasmeet0817 avatar lsaudon avatar m123-dev avatar monsieurtanuki avatar omkarchend1kar avatar openfoodfacts-bot avatar philippeauriach avatar prabeshpp avatar prathamsoni11 avatar primaelquemerais avatar slava-sh avatar stephanegigandet avatar sudhanva-nadiger avatar teolemon avatar vaiton avatar vik4114 avatar wildorangutan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smooth-app's Issues

Implement dark mode

  • Implement initial dark mode support in the app.
  • Add a toggle to ensure people can go back to light mode regardless of their system settings

Load attributes from the API

For the moment the list of attributes for the preferences is loaded from an asset file, in English, as a default mode.

There are 2 cases where we should reload that list:

  • if we want to match the end-user's language
  • if there are new attributes

The methods that loads the lists from json files already exist. (cf. #30)

Unable to Join Slack Channel

I want to contribute to this project, I have more than 2 years of experience with flutter but I am unable to join the slack channel. HELP!!

Theme refactoring using a ColorScheme

It would make sense to refactor the themes by using a ColorScheme as recommended in theme_data.dart:

  /// Create a [ThemeData] based on the colors in the given [colorScheme] and
  /// text styles of the optional [textTheme].
  ///
  /// The [colorScheme] can not be null.
  ///
  /// If [colorScheme.brightness] is [Brightness.dark] then
  /// [ThemeData.applyElevationOverlayColor] will be set to true to support
  /// the Material dark theme method for indicating elevation by applying
  /// a semi-transparent onSurface color on top of the surface color.
  ///
  /// This is the recommended method to theme your application. As we move
  /// forward we will be converting all the widget implementations to only use
  /// colors or colors derived from those in [ColorScheme].

In addition to that, there shouldn't be that many references to Theme.of(context) in the code, as the correct colors are supposed to be automatically computed from the Theme.

Load possible attributes that can have preferences from the API and cache them

Smoothie currently shows preferences that are hardcoded (Vegan, Vegetarian, Gluten Free etc.).

They should be loaded from the API instead:

List of all attributes:
https://world.openfoodfacts.org/api/v2/attribute_groups?lc=fr (lc indicates the language for the preferences names, descriptions, warnings etc.)

Possible values for each attribute, with translations:
https://world.openfoodfacts.org/api/v2/preferences?lc=fr

In order to be able to set / change preferences even if there is no network, the app should cache the possible preferences.*

Display logos of attributes for selected preferences in product card

The product cards in the "Choose" view should display the logos of the attributes corresponding to the preferences selected by the user, similar to how they are shown on the OFF web site for personal search.

(the personal search feature is currently in alpha-testing on the OFF web site, to have access to it, please send me your OFF username so that I can turn it on for you).

Current product cards show Nutri-Score, NOVA, CO2 (harcoded):

image

Need to be replaced by the attributes corresponding to the preferences:
image

The logos should come in the order of the preferences: mandatory preferences first, then very important, then important. For items of equal importance, use the order of preferences from the API (see #30).

The background color indicates if the product matches the user preferences (#33)

Display logos, warnings and descriptions when selecting preferences

After retrieving the attribute names, logos, warnings etc. (see #30 ), use them in the preferences selection page.

The preferences selection should be the same as on the OFF web site (except we should keep the range sliders we already have in the Flutter app instead of having radio buttons like on the web site).

(the personal search feature is currently in alpha-testing on the OFF web site, to have access to it, please send me your OFF username so that I can turn it on for you).

image

Switch from the localizely Flutter Intl plugin to the new Flutter internationalization / localization

The app currently use the Flutter Intl plugin from localizely to manage translations:
https://github.com/localizely/flutter-intl-plugin-sample-app

Flutter 1.22 announce https://medium.com/flutter/announcing-flutter-1-22-44f146009e5f#f2cb has a section "New internationalization and localization support" with a link to a Flutter Internationalization Guide in a google doc: https://docs.google.com/document/d/10e0saTfAv32OZLRmONy866vnaw0I2jwL8zukykpgWBc/edit

The 2 approaches look very similar (using .arb files to automatically generate dart code), but if there is now an official way, we probably should use it. The differences seem to be mostly in the name of the directories for the arb files and the generated code, as well as the name of the function to access the localized strings.

Refactor the use of database

For the moment, user preferences are stored in SharedPreferences, which is appropriate, and products are stored in a Sembast database in full_products_database.dart.

I'm not 100% convinced by Sembast, my personal taste is rather SQLite (with a bit of JSON in it), but this can be challenged, of course.

My concern is rather what we do with the database.
For the moment, not that much: we populate the database when we download products, but we never query the database.

I think it would be interesting to actually use the database:

  • being able, every time we store a product in it, to know when it happened and in which context (barcode, keywords, category search)
  • with that, we could implement the use of cached data - I downloaded category "breakfast cereals" yesterday, I don't need to download it again today - with the user being able to say "I want a systematic refresh, a refresh when the data is considered stale, let me decide each time" (with parameters in the preferences) (possibly with an AlertDialog #51 "we already have this data, do you want to reuse it or refresh it?")

Silent crash when saving preferences

How to replicate:

  1. open the app
  2. "Profile" / "Configure my preferences"
  3. "Save"
  4. No visible crash in the UI, but crash in the logs

The reason is that class UserPreferencesView has an optional Function callback constructor parameter that is called when you save the preferences. Even when callback was not populated, or populated with null.
Solution: check if callback is null before calling it.
For the record, the preferences are saved anyway, as they are saved before that crash.

I can create a PR if needed.

How to handle donations

What

In the current Android app (I suspect exactly the same on IOS), simple the the OFF website gets opened to donate, where the donations are processed via the donor box.
Which surprised me because the stores don't actually like to see it (see Apple vs EpicGames).

With the new app, I see potential to improve this. Both Apple and Google offer a non-profit program where 100% of the price goes to the non-profit company. Google offers even more advanced features with this program.
There is also an official plugin that offers in-app purchases.

What do you think about this idea

Part of

📶 🤳 Offline scanning (Tracker)

What

Tasks

  1. P2 offline mode timeouts ⏰ Stale
  2. Offline - Browsing ✨ enhancement
  3. Offline - Browsing 🐛 bug
    monsieurtanuki
  4. Offline Offline - Browsing
  5. Offline Offline - Browsing
  6. Offline Offline - Browsing 🎯 P1
    AshAman999
  7. Offline Offline - Browsing
  8. Offline Offline - Browsing 🎯 P1
  9. Offline Offline - Browsing
    AshAman999
  10. Offline Offline - Browsing
    AshAman999
  11. Offline - Browsing i18n translations ⚙️ Settings
    AshAman999

Why

  • No network or slow in supermarkets
  • Add offline scanning with a reduced local copy of the database so that users can scan offline.
  • This feature has been documented - Design document

Part of

Suggestion: more visible slider colors for preferences

Currently, the preference sliders are in white on light grey: not very visible in itself, and even with a black on white contrast the whole list would be boring to read.

We would be better off if the sliders' color was the same as the value they are supposed to display:

  • not important: black
  • important: green
  • very important: orange
  • mandatory: red

Or something like that.

For the record, current display:
Simulator Screen Shot - iPhone 8 Plus - 2021-01-11 at 12 56 56

Refactor photos upload photos for new product addition

We currently propose to take 3 pictures when the product is missing, and we pretend they are sent, which is currently a lie.

  • Actually upload photos for new product addition
  • Use a programming book or a non food object which is likely not in Open Food Facts

image

Color product cards in light green / red / white to show if it matches selected preferences

The background color of the product cards should indicate if the product matches the preferences selected by the user: light green = ok, light grey = maybe / missing information, light red = does not match (e.g. contains an allergen you are allergic to).

This is similar to how product cards are shown on the OFF web site for personal search.

(the personal search feature is currently in alpha-testing on the OFF web site, to have access to it, please send me your OFF username so that I can turn it on for you).

image

Rank all product lists according to user preferences

All lists of products in "choose" mode in Smoothie should be ranked and filtered according to the selected user preferences, with tabs ( #35 ) to separate matching and non-matching products, with colored product cards ( #33 ) and logos of the selected preferences ( #32 ).

This should apply in particular to:

  1. List of scanned products (when accessing "my personalized ranking)"
  2. Any saved list of products (e.g. products scan history)
  3. Search results
  4. List of products in a category (e.g. from category browser).

Roadmap update

Could someone please revise the roadmap and what is still needed and what the next development steps look like. That would make the development process much easier.

General thoughts from a first time user

My thoughts:

  1. I'm not convinced by the home page goal - obviously it's about food, but I would rather start with a list of filters (organic, eco score, Nutriscore). Don't show me all the foods on the planet, filter them first according to my tastes
  2. the order of the foods is somehow hidden
  3. as a vegan/vegetarian, there's no way I'm going to tolerate to see everyday meat, fish and so on - I wish I could be able to exclude categories in the home page, with preferences
  4. I'm not a big fan either of the horizontal scroll (list 1) + vertical scroll (list 2) in the home page: it brings confusion. I guess a vertical scroll on list 1 where a click shows a vertical scroll on list 2 would be better

ML Kit scan page starts camera after use

Today I noticed a bug when using the ML Kit scanner, when I opened the scan page once with the appropriate settings, (regardless of how long and whether there was a scan result or not), I get after closing the page (back button) at regular intervals 3-4 times per minute these three comments in the log.

I/CameraManagerGlobal(17991): Camera 1 facing CAMERA_FACING_FRONT state now CAMERA_STATE_ACTIVE for client com.samsung.adaptivebrightnessgo API Level 2
I/CameraManagerGlobal(17991): Camera 1 facing CAMERA_FACING_FRONT state now CAMERA_STATE_IDLE for client com.samsung.adaptivebrightnessgo API Level 2
I/CameraManagerGlobal(17991): Camera 1 facing CAMERA_FACING_FRONT state now CAMERA_STATE_CLOSED for client com.samsung.adaptivebrightnessgo API Level 2

I noticed after a short time that my phone also quickly became hotter, just as the performance was worse, but this also only imperceptible.

Test phone is from Samsung

Suggestion: additional local word filter

What

  • Currently, when I run a keyword query with "apple", I get about 500 products.
  • Use case: "that's too many products, and finally I'm only interested in 'apple sauce'". That would be nice to type in an additional local filter "apple sauce" (or "sauce").

Part of

Display logos and descriptions of attributes for selected preferences in top of product page

The top of the product page should show a summary of how well the product matches the preferences of the user. It is similar to the logos shown on the product cards ( #32 ), but with more detailed information. See the personal search feature on the OFF web site for a sample implementation.

(the personal search feature is currently in alpha-testing on the OFF web site, to have access to it, please send me your OFF username so that I can turn it on for you).

image

Display tabs for matching / maybe matching / non-matching products in products lists

Lists of products should use tabs to display:

  • all products in the list
  • products matching the user preferences
  • products that may match the user preferences (but we may be missing some data)
  • products that do not match the user preferences

See the personal search feature on the OFF web site for a sample implementation.

(the personal search feature is currently in alpha-testing on the OFF web site, to have access to it, please send me your OFF username so that I can turn it on for you).

image

Offline first / cache for svg files

When we go to the preferences, the svg icons are loaded from the internet.
What if I run my app offline: very bad impression indeed!

  1. We could afford default svg icons for all attributes in the app
  2. We could also cache svg icons - I know svg icons are somehow cached by SvgPicture.network but I don't know how often the cache is refreshed, which could mean either "there's something in the cache, so we will never care about updated internet svg files" or "let's try every 5 minutes to see if the svg file changed"

Implement a list system (also enabling a scan history)

Principles
Lists should be:

  • private to your device
  • exportable
  • optionally syncable across your devices using built-in system mechanisms such as iCloud or Google Drive app backup
  • importable

Lists should be:

  • very flexible although we can prepopulate with popular assumptions (eaten list, shopping list)
  • prevent 2 lists with the same name
  • sortable by date, nutriscore, brand, quantity, product name
  • History should be a special list

Issues with sqflite upserts and transactions

Apparently sqflite has not 100% the same syntax as SQLite, therefore the upsert statements must be slightly changed.

There's also something fishy about transactions, at least on Android: Warning database has been locked for 0:00:10.000000. Make sure you always use the transaction object for database operations during a transaction

Working on it...

Get the Eco-Score into smoothie

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.