New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: #3018 - UpToDateProductProvider now field of LocalDatabase #3220
fix: #3018 - UpToDateProductProvider now field of LocalDatabase #3220
Conversation
…atabase Impacted files: * `add_basic_details_page.dart`: got rid of `UpToDateProductProvider` * `add_new_product_page.dart`: got rid of `UpToDateProductProvider` * `edit_ingredients_page.dart`: got rid of `UpToDateProductProvider` * `edit_product_page.dart`: got rid of `UpToDateProductProvider` * `knowledge_panel_page.dart`: got rid of `UpToDateProductProvider` * `local_database.dart`: added an `UpToDateProductProvider` field * `main.dart`: got rid of `UpToDateProductProvider` * `new_product_page.dart`: got rid of `UpToDateProductProvider` * `nutrition_page_loaded.dart`: got rid of `UpToDateProductProvider` * `personalized_ranking_model.dart`: got rid of `UpToDateProductProvider` * `personalized_ranking_page.dart`: got rid of `UpToDateProductProvider` * `Podfile.lock`: wtf * `product_image_gallery_view.dart`: got rid of `UpToDateProductProvider` * `product_list_item_simple.dart`: got rid of `UpToDateProductProvider` * `product_list_page.dart`: got rid of `UpToDateProductProvider` * `product_refresher.dart`: got rid of `UpToDateProductProvider` * `simple_input_page.dart`: got rid of `UpToDateProductProvider` * `summary_card.dart`: got rid of `UpToDateProductProvider` * `up_to_date_product_provider.dart`: not a provider anymore; using `LocalDatabase` instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, thanks @monsieurtanuki
void set( | ||
final Product product, { | ||
final bool notify = true, | ||
}) { | ||
void set(final Product product) { | ||
_map[product.barcode!] = product; | ||
_timestamps[product.barcode!] = LocalDatabase.nowInMillis(); | ||
if (notify) { | ||
notifyListeners(); | ||
} | ||
localDatabase.notifyListeners(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know what exactly we used notify=false but we have to check that
Impacted files: * `product_list_page.dart`: format after merge conflict fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, one question is there though
On the new product page screen, I tried adding a new product
- the button to go to nutrition edit is disabled / hidden as the image is not yet uploaded
- I upload the photo and let it finish in the background
- After a few moments it's still not visible though the task of uploading photos is already done
Not sure if the contents of the page refreshed after the background task completed
I am not sure if the pages refreshed after we are done with the background task,
Since we are not using consumers , is that causing so ?
Thank you @M123-dev for your review! |
@AshAman999 I did nothing regarding the background tasks in this PR, it was just the first step. |
Impacted files:
add_basic_details_page.dart
: got rid ofUpToDateProductProvider
add_new_product_page.dart
: got rid ofUpToDateProductProvider
edit_ingredients_page.dart
: got rid ofUpToDateProductProvider
edit_product_page.dart
: got rid ofUpToDateProductProvider
knowledge_panel_page.dart
: got rid ofUpToDateProductProvider
local_database.dart
: added anUpToDateProductProvider
fieldmain.dart
: got rid ofUpToDateProductProvider
new_product_page.dart
: got rid ofUpToDateProductProvider
nutrition_page_loaded.dart
: got rid ofUpToDateProductProvider
personalized_ranking_model.dart
: got rid ofUpToDateProductProvider
personalized_ranking_page.dart
: got rid ofUpToDateProductProvider
Podfile.lock
: wtfproduct_image_gallery_view.dart
: got rid ofUpToDateProductProvider
product_list_item_simple.dart
: got rid ofUpToDateProductProvider
product_list_page.dart
: got rid ofUpToDateProductProvider
product_refresher.dart
: got rid ofUpToDateProductProvider
simple_input_page.dart
: got rid ofUpToDateProductProvider
summary_card.dart
: got rid ofUpToDateProductProvider
up_to_date_product_provider.dart
: not a provider anymore; usingLocalDatabase
insteadWhat
UpToDateProductProvider
field ofLocalDatabase
.LocalDatabase
but notUpToDateProductProvider
.notify
ingLocalDatabase
.Part of