我正在尝试通过http get请求获取一些数据。这是我的代码:
Future searchProducts(String search) async {
var response = await http.get(baseUrl + 'searchProducts');
var jsonResponse = await convert.jsonDecode(response.body);
print(jsonResponse['result'].length);
}
我正在尝试在响应的正文中获取列表。当列表太大时,我收到此错误:
E/flutter (12726): [ERROR:flutter/lib/ui/ui_dart_state.cc(157)] Unhandled Exception: type '(HttpException) => Null' is not a subtype of type '(dynamic) => dynamic'
如果我限制获取的数据:
I/flutter (12726): 20