Flutter: NoSuchMethodError: The
2019-10-19 本文已影响0人
一点大话
Flutter出现以下错误:
NoSuchMethodError: The method ' / was called on null.
Receiver: null
Tried calling: /(1334.0)

解决方案:在调用前先对ScreenUtil.instance初始化宽高,如下:
ScreenUtil.instance = ScreenUtil(width: 750, height: 1334)..init(context);