-
-
Notifications
You must be signed in to change notification settings - Fork 287
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
feat: #2396 - new widget SmoothProductCardTemplate #2593
feat: #2396 - new widget SmoothProductCardTemplate #2593
Conversation
New files: * `smooth_product_card_template.dart`: Empty template for a product card display. * `smooth_product_image_container.dart`: Container to display the main product image on a product card. Impacted files: * `smooth_product_card_found.dart`: fix as `backgroundColor` was not taken into account anymore * `smooth_product_image.dart`: refactored with new class `SmoothImageContainer`
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 just a lot of magic numbers, I guess most of them are not introduced by you but taken from the original card, but they should still be a const or dynamic in other places.
height: iconSize * .9, | ||
width: 240 * iconSize / 130, |
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 guess you took these values from the original card. We should store them in a const
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.
Fair enough, but I don't know how to do that cleanly. You see, the 240x130 ratio comes from the svg files themselves.
The general idea is to have a template that looks similar to a real product card, not to match it in every detail, especially for a widget that is transient.
width: screenSize.width * .4, | ||
height: screenSize.width * .05, |
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.
Some magic numbers, what happenes when someone changes the font size
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 care about the font size, I just want 3 lines that fit in width * .2
as in the original card.
Thank you @M123-dev for your quick review! |
New files:
smooth_product_card_template.dart
: Empty template for a product card display.smooth_product_image_container.dart
: Container to display the main product image on a product card.Impacted files:
smooth_product_card_found.dart
: fix asbackgroundColor
was not taken into account anymoresmooth_product_image.dart
: refactored with new classSmoothImageContainer
What
SmoothProductCardTemplate
SmoothProductCardTemplate
.Screenshot
This is what
SmoothProductCardTemplate
looks like (as a test I display every other product with the template, but this is obviously not what will happen IRW):Part of