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

OVERFLOWING when iPhone rotates #6

Open
TUKenStone opened this issue Mar 26, 2020 · 4 comments
Open

OVERFLOWING when iPhone rotates #6

TUKenStone opened this issue Mar 26, 2020 · 4 comments

Comments

@TUKenStone
Copy link

The specific RenderFlex in question is: RenderFlex#d63a4 relayoutBoundary=up5 OVERFLOWING
... parentData: (can use size)
... constraints: BoxConstraints(w=418.0, 0.0<=h<=59.3)
... size: Size(418.0, 59.3)
... direction: vertical
... mainAxisAlignment: center
... mainAxisSize: max
... crossAxisAlignment: center
... verticalDirection: down
◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤◢◤
════════════════════════════════════════════════════════════════════════════════════════════════════

════════ (2) Exception caught by rendering library ═════════════════════════════════════════════════
A RenderFlex overflowed by 57 pixels on the bottom.
The relevant error-causing widget was:
Column file:///Users/kenaitian/projects/bmi-calculator-flutter/lib/icon_content.dart:12:12
════════════════════════════════════════════════════════════════════════════════════════════════════

@MohammadAlhallaq
Copy link

same problem ..
have you found any solution?

@fbitti
Copy link

fbitti commented Apr 25, 2020

Yes, this solution https://stackoverflow.com/a/56327933 worked for me, and not only the content overflow error disappeared, the resulting screen expands to match the new orientation so it also looks good.
In each page of your app, cut your Column(...), code and paste it inside the following block of code.

LayoutBuilder(
          builder: (context, constraint) {
            return SingleChildScrollView(
              child: ConstrainedBox(
                constraints: BoxConstraints(minHeight: constraint.maxHeight),
                child: IntrinsicHeight(
                  child: // <=== the Column(...), code comes here
                ),
              ),
            );
          },
        ),

I tested it in both the Android emulator and the iPhone simulator. Please confirm it also works for you.
I wish Flutter already had a simpler widget for this task, maybe it does but I couldn't find one. But, hey, we may always create our own widget as Angela taught us.

@fbitti
Copy link

fbitti commented Apr 25, 2020

For completeness, this is how your Scaffold should look with the above changes:

Scaffold(
      appBar: AppBar(
        title: Text('BMI CALCULATOR'),
      ),
      body: LayoutBuilder(...),
);

@Sushil211
Copy link

Yes, this solution https://stackoverflow.com/a/56327933 worked for me, and not only the content overflow error disappeared, the resulting screen expands to match the new orientation so it also looks good.
In each page of your app, cut your Column(...), code and paste it inside the following block of code.

LayoutBuilder(
          builder: (context, constraint) {
            return SingleChildScrollView(
              child: ConstrainedBox(
                constraints: BoxConstraints(minHeight: constraint.maxHeight),
                child: IntrinsicHeight(
                  child: // <=== the Column(...), code comes here
                ),
              ),
            );
          },
        ),

I tested it in both the Android emulator and the iPhone simulator. Please confirm it also works for you.
I wish Flutter already had a simpler widget for this task, maybe it does but I couldn't find one. But, hey, we may always create our own widget as Angela taught us.

Yeah man, that works!! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants