我在Consumer()中实现了GridView.count并收到以下错误:exp
但是当我尝试打印列表长度时,它不是null。
The getter 'length' was called on null.
这是我的代码:
I/flutter ( 6581): 7
════════ Exception caught by widgets library ═══════════════════════════════════
The following NoSuchMethodError was thrown building NotificationListener<KeepAliveNotification>:
The getter 'length' was called on null.
Receiver: null
Tried calling: length
如何解决此问题?即使长度不为null。
注意:此问题是由另一个API调用引起的,该API返回null且未正确处理。