flutter_ScreenUtil
flutter 屏幕适配方案,让你的UI在不同尺寸的屏幕上都能显示合理的布局!
github: https://github.com/OpenFlutter/flutter_screenutil
使用方法:
安装依赖:
安装之前请查看最新版本
1 | dependencies: |
在每个使用的地方导入包:
1 | import 'package:flutter_screenutil/flutter_screenutil.dart'; |
属性
属性 | 类型 | 默认值 | 描述 |
---|---|---|---|
width | double | 1080px | 设计稿中设备的宽度,单位px |
height | double | 1920px | 设计稿中设备的高度,单位px |
allowFontScaling | bool | false | 设置字体大小是否根据系统的“字体大小”辅助选项来进行缩放 |