initContext static method

dynamic initContext(
  1. BuildContext context
)

Implementation

static initContext(BuildContext context) {
  if (!MediaQuery.of(context).size.isEmpty) {
    mediaQuery = MediaQuery.of(context);
    _width = mediaQuery!.size.width;
    _height = mediaQuery!.size.height;
    _top = mediaQuery!.padding.top;
    _bottom = mediaQuery!.padding.bottom;
    _devicePixelRatio = mediaQuery!.devicePixelRatio;
  }
}