skip to Main Content

i’m trying to make a page that has 8 widget in 2 column , every column involve 2 widget for image and under every image , one bottun. I used textbutton and image in a column.but it overflowed .could you help me?

I used column ,image and textbutton but it always overflow.

2

Answers


  1. You have 2 options:

    1. Alter your widgets so that the total height doesn’t exceed the screen height.
    2. Implement scrolling.

    If you decide to make it scrollable, the easiest way would just be to wrap the Column in a SingleChildScrollView. You’ll need to make sure the Column’s mainAxisSize is set to MainAxisSize.min, and you’ll need to make sure that nothing in the column has an unbounded height.

    Login or Signup to reply.
  2. Your question is very badly structured and you didn’t provide any relevant code, so I’m guessing you’re relatively new to Stack Overflow and to Flutter.

    In flutter, if you don’t want your stuff in a Column or a row to overflow, you need to make that stuff scrollable. You can do this by wrapping the row or column in a scrollable widget eg a SingleChildScrollView like this.

    SingleChildScrollView(
          child: Row(
            children: [],
          ),
        )
    

    If you’re using VS Code, you can do this easily by right clicking on the word Row or Column, click on "Refactor", then click on Wrap with Center. Then simply change the word Center to SingleChildScrollView

    Be careful though not to put a single child scroll view inside another single child scroll view. It won’t render well and will cause errors.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search