【发布时间】:2019-11-19 22:15:19
【问题描述】:
我是 Flutter 的新手,所以说实话我不知道为什么会收到此错误。
List < BaseResponse > pEShippingDetail = [];
Future loadMessageList() async {
http.Response response = await http.get('http://www.efwebservice.com/Public/api/ShipmentItems/GetShippingDetails?token=XE9QZEA5ZLRJ64FLO4210&projectid=1010408');
//await Future.delayed(Duration(seconds: 3));
String content = response.body;
List collection = json.decode(content);
List < BaseResponse > _messages = collection.map((json) => BaseResponse.fromJson(json)).toList();
setState(() {
pEShippingDetail = _messages;
});
}
void initState() {
loadMessageList();
super.initState();
}
【问题讨论】: