getHorizontalSize function

double getHorizontalSize(
  1. double px
)

This method is used to set padding/margin (for the left and Right side) & width of the screen or widget according to the Viewport width.

Implementation

double getHorizontalSize(double px) {
  return ((px * width) / FIGMA_DESIGN_WIDTH);
}