Skip to content
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

Merged
merged 3 commits into from
Feb 20, 2023

Conversation

Adiii1436
Copy link
Contributor

Fixed #3700
Before:
photo_2023-02-13_11-12-33

After:
photo_2023-02-18_01-23-27

It is checked and verified on various screen sizes.

Copy link
Contributor

@monsieurtanuki monsieurtanuki left a 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),
Copy link
Contributor

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 and flex

Copy link
Contributor Author

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,
Copy link
Contributor

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.

@Adiii1436
Copy link
Contributor Author

I have made changes @monsieurtanuki

Copy link
Contributor

@monsieurtanuki monsieurtanuki left a 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!

@monsieurtanuki monsieurtanuki merged commit 7159773 into openfoodfacts:develop Feb 20, 2023
@Adiii1436 Adiii1436 deleted the fixed#3700 branch February 20, 2023 14:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fixing widget overflow issues in product editing page.
2 participants