-
-
Notifications
You must be signed in to change notification settings - Fork 313
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: 3700 - Fixed widget overflow issues in product editing page #3714
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.
Hi @Adiii1436!
Please have a look at my comments: I'm sure we'd be better off with Expanded
/ flex
.
@@ -228,15 +228,15 @@ class _NutritionPageLoadedState extends State<NutritionPageLoaded> { | |||
crossAxisAlignment: CrossAxisAlignment.center, | |||
children: <Widget>[ | |||
SizedBox( | |||
width: getColumnSizeFromContext(context, 0.6), | |||
width: getColumnSizeFromContext(context, 0.55), |
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.
A clean solution would use Expanded
and flex
:
- we set a fixed width for the unit column (e.g.
getColumnSizeFromContext(context, 0.3)
- and we let flutter compute the correct size with
Expanded
andflex
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.
Yes! This is a better solution. Thankyou @monsieurtanuki .
width: constraints.maxWidth - | ||
LARGE_SPACE - | ||
(withClearButton ? MINIMUM_TOUCH_SIZE : 0), | ||
width: constraints.maxWidth - LARGE_SPACE - MINIMUM_TOUCH_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.
Same thing here: use Expanded
/ flex
for the "as big as possible" item, and a fixed size for the trailing widget.
I have made changes @monsieurtanuki |
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, thank you @Adiii1436!
Fixed #3700

Before:
After:

It is checked and verified on various screen sizes.