提交 4c511711 编写于 作者: 李卓原

添加示例

上级 94af1bac
此差异已折叠。
......@@ -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" />
......
此差异已折叠。
......@@ -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),
......
<?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.
先完成此消息的编辑!
想要评论请 注册