Home > Net >  Assigning values to Flutter widgets
Assigning values to Flutter widgets

Time:07-25

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

enter image description here

CodePudding user response:

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.

  • Related