setup static method

void setup(
  1. BuildContext context,
  2. Size screenSize
)

Setup the screen with a context and the size you will use. So, if you have a design with 1280 * 720. You will pass first the context then the design size.

  Scale.setup(context, Size(1280, 720))

Implementation

static void setup(BuildContext context, Size screenSize) {
  final MediaQueryData mediaQuery = MediaQuery.of(context);
  _deviceScreenSize = mediaQuery.size;
  size = screenSize;
}