-
-
Notifications
You must be signed in to change notification settings - Fork 280
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
Dynamically limit the number of elements rendered on Scan card. #648
Conversation
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.
Hello @jasmeet0817, I see what you are trying to do here, but I fear that the current way will cause problems when the screensize and the user settings deviate too much from the norm.
We should definitely test out this PR
Some time ago I have worked on making the app responsive and I can really recommend device_preview, you have to add it to the code and remove it before merging but it is great for testing different screen sizes and font sizes etc..
// Each row in the summary card takes roughly 40px. | ||
const int SUMMARY_CARD_ROW_HEIGHT = 40; |
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.
That's hard to say, what happens if the user has as an example adjusted his font size
Marvin, thanks for the tip, I tested the change on several devices using DevicePreview, it looks fine, moreover, I'm now clipping any overflowing elements so we don't get an overflow error |
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.
Thanks Jasmeet, the code looks good. An almost perfect solution is in any case better than none at all. We should however add an issue or a todo so that this task can be found.
Mentioned it in the launch tracker: #655 |
Render only a limited amount of elements on the summary card if it's being shown in the scan page. Even though the code tries to dynamically determine the number of elements to render, it's possible that the elements try to overflow the summary card, in this case we clip the overflown widget (which may not look pretty)
This is a poor man's solution, the proper (and lengthy) way would be to build a custom render object.
Bonus: Standardize the size of Summary card and Search card.
Scan Page:
!
Product page (unchanged):