- 在pubspec.yaml文件導入:
flutter_screenutil: ^0.6.0
- 初始化: 美工提供的UI設計尺寸ScreenUtil.instance = ScreenUtil(width: 1080, height: 2160)..init(context);
- 字體大小: Text( list[index].mallName, style: TextStyle(fontSize: ScreenUtil().setSp(24)), ),
- 適配屏幕尺寸:
height: ScreenUtil().setHeight(80), width: ScreenUtil().setWidth(570),