Flutter–使用ScreenUtil进行屏幕适配
2020年8月23日 16:56:19
使用插件flutter_ScreenUtil
引用
dependencies:
flutter_screenutil: ^2.3.1 # 屏幕适配
在main.dart
中引用
ScreenUtil.init(
context,
width: 750,
height: 1334,
allowFontScaling: true,
);
组件库 https://pub.dev/packages/flutter_screenutil
中文文档 https://github.com/OpenFlutter/flutter_screenutil/blob/master/README_CN.md