the method getInstance() isn't defined for 'screenutil' flutter

Viewed 205

I'm working on flutter project .I'm trying to fix errors on my project after migration to null safety . I have error on this line :

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

error : the method 'getinstance' isn't defined for the type 'screenutil'

with flutter_screenutil: ^5.0.0

How I can fix it ?

Thanks in advance

1 Answers

according to the docs the correct implementation is:

ScreenUtil().setHeight(35)
Related