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
Endless rebuild in product_image_gallery_view.dart #3238
Comments
Additional thoughts:
|
@AshAman999 I think the bug comes from your #3023:
But beyond that endless loop, there are some things I'd like to understand better. On that screen, there are 4 main images, one "other" empty image, then all images. The "other" image is by construction ALWAYS empty: shouldn't we get rid of it, in favor of an "add picture" button? For some historical reason, the It looks like the only thing we can do about a picture on that screen is to (re)take a picture and crop it:
That means that "other" pictures are in a specific zone of "just in case" pictures that cannot be promoted to the "main" zone. My question is: does that make sense to include ALL pictures instead of using only the MAIN pictures? |
Hello @monsieurtanuki I Agree with you, loading all the pics by default only creates the overhead of API calls, we were better with the 4, for others, it would make another screen to do so, |
Oh my point was not to say your code was wrong, my point was to check if my understanding was correct (in order to fix the bug) and to get your opinion on my other questions (as you've already coded on this page, you may already have exchanged on the "picture situation"). Thank you for your additional answer, as you confirm that it would be more user-friendly to show only the main 4, and perhaps later to show all pictures in an additional page, if needed. |
…ust the main 4) Impacted files: * `product_cards_helper.dart`: added an optional parameter in order to ignore "other" pictures * `product_image_gallery_view.dart`: removed the "other" pictures
What
While debugging, I added a
print
in thebuild
method ofproduct_image_gallery_view.dart
, and noticed that it was constantly refreshed (like several times per second).Steps to reproduce the behavior
product_image_gallery_view.dart
print
at the start of thebuild
methodprint
is constantly calledExpected behavior
During the init the
print
may appear several times, but not forever.Why
In the
build
somesetState
s are calledasync
ly, which means that the build calls itself again and again.I cannot predict how bad it is, but basically - beyond the performances that are not an issue in this page AFAIK - it means that never have reliable fields, as they're constantly being refreshed (probably with the same values, though).
The text was updated successfully, but these errors were encountered: