Giter Site home page Giter Site logo

Comments (4)

MohammadAlhallaq avatar MohammadAlhallaq commented on August 27, 2024 1

same problem ..
have you found any solution?

from bmi-calculator-flutter.

fbitti avatar fbitti commented on August 27, 2024

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.

from bmi-calculator-flutter.

fbitti avatar fbitti commented on August 27, 2024

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

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

from bmi-calculator-flutter.

Sushil211 avatar Sushil211 commented on August 27, 2024

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.

from bmi-calculator-flutter.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.