【问题标题】:the method getInstance() isn't defined for 'screenutil' flutter没有为“screenutil”颤振定义方法 getInstance()
【发布时间】:2021-08-14 10:58:58
【问题描述】:

我正在处理颤振项目。我正在尝试在迁移到 null 安全后修复我的项目中的错误。我在这一行有错误:

SizedBox(
           height: ScreenUtil.getInstance().setHeight(35),
          ),

错误:没有为“screenutil”类型定义方法“getinstance”

使用flutter_screenutil:^5.0.0

我该如何解决?

提前致谢

【问题讨论】:

    标签: flutter dart


    【解决方案1】:

    根据docs,正确的实现是:

    ScreenUtil().setHeight(35)
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-05-12
      • 2022-01-21
      • 2020-11-05
      • 2022-01-17
      • 1970-01-01
      • 1970-01-01
      • 2023-03-03
      • 1970-01-01
      相关资源
      最近更新 更多