init method

void init(
  1. BoxConstraints constraints,
  2. Orientation orientation
)

the method to initialize SizeConfig for responsive calculation

Implementation

void init(BoxConstraints constraints, Orientation orientation) {
  if (orientation == Orientation.portrait) {
    _screenWidth = constraints.maxWidth;
    _screenHeight = constraints.maxHeight;
    isPortrait = true;
    if (_screenWidth! < 450) {
      isMobilePortrait = true;
    }
  } else {
    _screenWidth = constraints.maxHeight;
    _screenHeight = constraints.maxWidth;
    isPortrait = false;
    isMobilePortrait = false;
  }

  imageSizeMultiplier =
      heightMultiplier = _screenHeight! / designScreenHeight!;
  widthMultiplier = textMultiplier = _screenWidth! / designScreenWidth!;
}