Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
__卓原
flutter_screenutil
提交
4c511711
F
flutter_screenutil
项目概览
__卓原
/
flutter_screenutil
通知
10
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
3
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
F
flutter_screenutil
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
3
Issue
3
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
4c511711
编写于
9月 24, 2018
作者:
李
李卓原
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
添加示例
上级
94af1bac
变更
5
展开全部
隐藏空白更改
内联
并排
Showing
5 changed file
with
370 addition
and
95 deletion
+370
-95
.idea/libraries/Dart_Packages.xml
.idea/libraries/Dart_Packages.xml
+172
-51
.idea/screenutil.iml
.idea/screenutil.iml
+3
-0
.idea/workspace.xml
.idea/workspace.xml
+166
-26
README.md
README.md
+15
-18
example/example.iml
example/example.iml
+14
-0
未找到文件。
.idea/libraries/Dart_Packages.xml
浏览文件 @
4c511711
此差异已折叠。
点击以展开。
.idea/screenutil.iml
浏览文件 @
4c511711
...
...
@@ -6,6 +6,9 @@
<excludeFolder
url=
"file://$MODULE_DIR$/.dart_tool"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/.pub"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/example/.dart_tool"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/example/.pub"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/example/build"
/>
</content>
<orderEntry
type=
"inheritedJdk"
/>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
...
...
.idea/workspace.xml
浏览文件 @
4c511711
此差异已折叠。
点击以展开。
README.md
浏览文件 @
4c511711
...
...
@@ -52,14 +52,14 @@ height: ScreenUtil().setHeight(200),
其他相关api:
print(ScreenUtil.pixelRatio);
//设备的像素密度
print(ScreenUtil.screenWidth);
//设备宽度
print(ScreenUtil.screenHeight); //设备高度
print(ScreenUtil.bottomBarHeight);
//底部安全区距离,适用于全面屏下面有按键的
print(ScreenUtil.statusBarHeight);
//状态栏高度 刘海屏会更高
ScreenUtil.pixelRatio
//设备的像素密度
ScreenUtil.screenWidth
//设备宽度
ScreenUtil.screenHeight //设备高度
ScreenUtil.bottomBarHeight
//底部安全区距离,适用于全面屏下面有按键的
ScreenUtil.statusBarHeight
//状态栏高度 刘海屏会更高
print(ScreenUtil().scaleWidth);
//宽度相对于设计稿放大的倍数
print(ScreenUtil().scaleHeight);
//高度相对于设计稿放大的倍数
ScreenUtil().scaleWidth
//宽度相对于设计稿放大的倍数
ScreenUtil().scaleHeight
//高度相对于设计稿放大的倍数
```
...
...
@@ -70,17 +70,14 @@ import 'package:flutter_app/ScreenUtil.dart'; //导入
Widget build(BuildContext context) {
print(ScreenUtil().setWidth(180));
print(ScreenUtil().setWidth(540));
print(ScreenUtil.screenWidth / ScreenUtil.pixelRatio);
print(ScreenUtil.pixelRatio); //设备的像素密度
print(ScreenUtil.screenWidth); //设备宽度
print(ScreenUtil.screenHeight); //设备高度
print(ScreenUtil.bottomBarHeight); //底部安全区距离,适用于全面屏下面有按键的
print(ScreenUtil.statusBarHeight); //状态栏高度 刘海屏会更高
print(ScreenUtil().scaleWidth); //宽度相对于设计稿放大的倍数
print(ScreenUtil().scaleHeight); //高度相对于设计稿放大的倍数
print('设备的像素密度:${ScreenUtil.pixelRatio}'); //设备的像素密度
print('设备宽度:${ScreenUtil.screenWidth}'); //设备宽度
print('设备高度:${ScreenUtil.screenHeight}'); //设备高度
print('底部安全区距离:${ScreenUtil.bottomBarHeight}'); //底部安全区距离,适用于全面屏下面有按键的
print('状态栏高度:${ScreenUtil.statusBarHeight}px'); //状态栏高度 刘海屏会更高
print('宽度相对于设计稿放大的倍数:${ScreenUtil().scaleWidth}'); //宽度相对于设计稿放大的倍数
print('高度相对于设计稿放大的倍数:${ScreenUtil().scaleHeight}'); //高度相对于设计稿放大的倍数
return new Scaffold(
appBar: new AppBar(
title: new Text(widget.title),
...
...
example/example.iml
0 → 100644
浏览文件 @
4c511711
<?xml version="1.0" encoding="UTF-8"?>
<module
type=
"JAVA_MODULE"
version=
"4"
>
<component
name=
"NewModuleRootManager"
inherit-compiler-output=
"true"
>
<exclude-output
/>
<content
url=
"file://$MODULE_DIR$"
>
<excludeFolder
url=
"file://$MODULE_DIR$/.dart_tool"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/.pub"
/>
<excludeFolder
url=
"file://$MODULE_DIR$/build"
/>
</content>
<orderEntry
type=
"sourceFolder"
forTests=
"false"
/>
<orderEntry
type=
"library"
name=
"Dart SDK"
level=
"project"
/>
<orderEntry
type=
"library"
name=
"Dart Packages"
level=
"project"
/>
</component>
</module>
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录