Skip to content

Commit

Permalink
Merge pull request #183 from Tkko/patch-1
Browse files Browse the repository at this point in the history
Changed window reference
  • Loading branch information
lizhuoyuan authored Dec 21, 2020
2 parents 5e89e8c + ca1e204 commit bcc55f3
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib/screenutil.dart
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
*/

import 'package:flutter/material.dart';
import 'dart:ui' as ui;

class ScreenUtil {
static const Size defaultSize = Size(1080, 1920);
Expand Down Expand Up @@ -43,7 +42,7 @@ class ScreenUtil {
_screenWidth = constraints.maxWidth;
_screenHeight = constraints.maxHeight;

var mediaQuery = ui.window;
var mediaQuery = WidgetsBinding.instance.window;
_pixelRatio = mediaQuery.devicePixelRatio;
_statusBarHeight = mediaQuery.padding.top;
_bottomBarHeight = mediaQuery.padding.bottom;
Expand Down

0 comments on commit bcc55f3

Please sign in to comment.