在抖动中使用网络映像时,有时会出现错误Connection closed before full header was received
。下面的代码允许我输出错误,但是如何强制窗口小部件重新加载图像?
Image.network(p.thumbURL,
errorBuilder: (BuildContext context, Object exception, StackTrace stackTrace) {
Log.e(exception);
return Container();
},
),
答案 0 :(得分:0)
key: ValueKey(url),
setState(() {
url = url.split('?r')[0] + '?r=' + DateTime.now().millisecondsSinceEpoch.toString();
});