OpenFlutter / flutter_screenutil

Flutter screen adaptation, font adaptation, get screen information
https://pub.dartlang.org/packages/flutter_screenutil
Apache License 2.0
3.87k stars 493 forks source link

请问是否一定要在 main 中注册 #465

Closed ReverseScale closed 1 year ago

ReverseScale commented 1 year ago

项目和 example 中没有这句话好像也没什么问题,请问是否可以不写呢?

void main() async {
  // Add this line
  await ScreenUtil.ensureScreenSize();
ReverseScale commented 1 year ago

看起来这个是必须的

ScreenUtil.init(context, designSize: const Size(360, 800));

ScreenUtil.ensureScreenSize()不是

lizhuoyuan commented 1 year ago

是的 , await ScreenUtil.ensureScreenSize();完全可以不写