Toggle navigation
Toggle navigation
This project
Loading...
Sign in
flutter_package
/
flutter_screenutil
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
李卓原
2020-12-21 19:04:38 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
22687b9b38e96ee6db891e10eca06762201ee498
22687b9b
1 parent
bcc55f38
change window, and null safety
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletions
lib/screenutil.dart
lib/screenutil.dart
View file @
22687b9
...
...
@@ -3,6 +3,8 @@
* email: zhuoyuan93@gmail.com
*/
import
'dart:ui'
as
ui
;
import
'package:flutter/material.dart'
;
class
ScreenUtil
{
...
...
@@ -42,7 +44,7 @@ class ScreenUtil {
_screenWidth
=
constraints
.
maxWidth
;
_screenHeight
=
constraints
.
maxHeight
;
var
mediaQuery
=
WidgetsBinding
.
instance
.
window
;
var
mediaQuery
=
WidgetsBinding
.
instance
?.
window
??
ui
.
window
;
_pixelRatio
=
mediaQuery
.
devicePixelRatio
;
_statusBarHeight
=
mediaQuery
.
padding
.
top
;
_bottomBarHeight
=
mediaQuery
.
padding
.
bottom
;
...
...
Please
register
or
login
to post a comment