Why should you never give a hard-coated height to a container which has widgets/Pixel overflow from the bottom of the container error

Why should you never give a hard-coated height to a container which has widgets/Pixel overflow from the bottom of the container error

·

1 min read

Table of contents

No heading

No headings in the article.

As we know flutter web is getting very popular and there are not a lot of answers available on the web as these are simple rules to keep in mind before doing any project here is why we never hardcore the height of a container if you want to add widgets in them

Here is an image of the Pixel overflow

hash1.png

The first thing that comes to your mind is why not just increase the container height Booom!! it's solved but think again!! when you see it on a phone/desktop with different sizes you get the same error because as the screen size decreases the widgets too will decrease and the SingleChildScrollView will take care of the rest.

hash2.png

Now even if you resize it the container will remain the same size and therefore the overflow issue is eliminated.

It's the small things like this that can make you want to quit flutter but don't give up keep on trying!!!

Akash Uday