Container vs SizedBox in Flutter
Hi Coder,
Welcome back to codemicros,
You must be familiar with these two widgets (Container and SizedBox) in Flutter But have you ever wondered why Flutter create 2 widgets for the same purpose or are we missing something else.
So let's find out what we are missing 😎
You can see my YouTube video on this topic 👉Container vs SizedBox in flutter
SizedBox:
Sized box is basically used to create a box with some height and width and except these two things it will do nothing but On the other hand
Container:
Container is just not only to use as to create box but also to decorate it as we can say that we can do a lot more with container like Decoration,Alignment,Constraints,Transform,Padding etc.
Conclusion:
You you only want to wrap your item/child with box without any extra decoration then Flutter provide you sized box But if you want to do more than just wrap with box then Flutter provide you container .
THANK YOU
#flutter #flutter widget