callBack method
dynamic
callBack(
- int? code,
- String? msg,
- dynamic content
)
Implementation
callBack(int? code, String? msg, content) {
//加载页面完成后 对页面重新测量的回调
if (code == 201) {
double widgetPerentHeight = MediaQuery.of(context).size.height * 3;
findCurrentDy();
//double flagHeight = widgetPerentHeight;
if (_webViewHeight == null) {
if (content <= widgetPerentHeight) {
_webViewHeight = content;
if (widget.minHeight != null && _webViewHeight! < widget.minHeight!) {
_webViewHeight = widget.minHeight;
}
isScrollHex = false;
} else {
_webViewHeight = widgetPerentHeight;
isScrollHex = true;
}
}
isHideLoading = true;
//更新高度
setState(() {});
print("webViewHeight " + content.toString());
} else if (code == 301 && widget.headerWidget != null) {
print("_scrollPhysics 更新");
//其他回调
_scrollPhysics = ClampingScrollPhysics();
setState(() {});
}
if (widget.callback != null) {
widget.callback!(code, msg, content);
}
}