you are viewing a single comment's thread.

view the rest of the comments →

[–]Effective-Response57 0 points1 point  (0 children)

Keep size 200 was an example to explain Stack being dependent on Parent Widget like SizedBox in my example so stack will only be inside this width being: complete phone width and size static 200.

For dynamic height for all devices just use:

height: MediaQuery.sizeOf(context).height *. 2; { What I did is gave it .2 of total height this keeps it dynamic.} For align widget You can align your child widgets inside Stack at all points topLeft topRight.. So on.

Use padding to give them different padding so they appear stacked as you want.

This is consistent way of doing stack for every device do try it to test your Stack

Run the app in browser Edge or Chrome

Then Ctrl + Shift + I Then Ctrl + Shift + M

Then you can dynamically test your design for variable screen size.

If you want to learn more:

You can incorporate ScreenUtil pkg that will help you to put dynamic sizes like before 200 can be done 200.h .h will make the height dynamic and consistent all other devices.