Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Assigning values to Flutter widgets

Sizedbox, container and similar widgets border radius, height, width is better to give int value or double?
How does this affect the speed and quality of the program?

Which is better

enter image description here

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

enter image description here

>Solution :

It does not matter, in this specific example. The Container constructor takes double? for width and height so if you are providing integers, they will just be converted into double by the compiler when compiling the application. So no difference at all when running the program.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading