ScreenConfig constructor
ScreenConfig(
- BuildContext context
Implementation
ScreenConfig(BuildContext context) {
screenWidth = MediaQuery.of(context).size.width;
screenHeight = MediaQuery.of(context).size.height;
shortestSide = MediaQuery.of(context).size.shortestSide;
final factor = shortestSide < 600 ? 1 : 0.5;
horizontalScale = screenWidth / screenWidthTarget * factor;
verticalScale = screenHeight / screenHeightTarget * factor;
}