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
You have 2 options:
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’smainAxisSize
is set toMainAxisSize.min
, and you’ll need to make sure that nothing in the column has an unbounded height.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.
If you’re using VS Code, you can do this easily by right clicking on the word
Row
orColumn
, click on "Refactor", then click onWrap with Center
. Then simply change the wordCenter
toSingleChildScrollView
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.