此错误 The getter 'length' was called on null.,它在列表userdata变量中传递数据,并调用widget webview问题是,在加载它之前,在加载它之前,在null上调用了show length,加载后它工作正常,请检查我的代码并帮助我 下面是我的代码import 'dart:async';
import 'package:flutter
我正在尝试从JSON rest API in Flutter获取平均评级列表。当所有产品都有评分值时,列表视图显示正常,但当任何产品的评分为空时,列表视图返回错误"NoSuchMethodError: getter ' length‘is null on null。Receiver: null。已尝试调用:length。
我有提供程序,我接受列表的初始值为null。在打开应用程序的第一个实例中,我收到错误消息"The getter 'length‘i on null“。因为我在家庭小工具中使用此提供程序。class BagProvider with ChangeNotifier {
Consumer<BagProvider>(