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
771 stars 265 forks source link

Don't use FutureBuilders #4882

Open monsieurtanuki opened 8 months ago

monsieurtanuki commented 8 months ago

Oh no, please don't use a FutureBuilder, that's the shittiest Widget ever. A separated class with a ValueNotifier-like thing or I don't know which state management solution, but never mix UI with how the data is fetched.

I know the app uses this pattern everywhere, but if I can stop the spreading of this 🦠, I prefer.

_Originally posted by @g123k in https://github.com/openfoodfacts/smooth-app/pull/4866#discussion_r1420543848_

ishanvaghani commented 7 months ago

Hey @monsieurtanuki and @g123k,

I want to start on this. Any alternatives you have in your mind? I recently started open source contribution so i think this would be good challenging task for me.

monsieurtanuki commented 7 months ago

Hi @ishanvaghani! I'll let @g123k answer you about a better technical solution, as it was his initial remark. My only suggestion would be to focus on one single class first, e.g. CountrySelector.