修复移除监听的写法

master
章文轩 2 years ago
parent 6daab5f969
commit db695f53b4

@ -127,24 +127,18 @@ class _ChatKFPageState extends State<ChatKFPage>
print('发生改变!!!!!!!!!!'); print('发生改变!!!!!!!!!!');
print('customGoods'+customGoods); print('customGoods'+customGoods);
print('BytedeskUtils.goodsInfo.value'+BytedeskUtils.goodsInfo.value); print('BytedeskUtils.goodsInfo.value'+BytedeskUtils.goodsInfo.value);
if(customGoods==BytedeskUtils.goodsInfo.value)
return;
customGoods = BytedeskUtils.goodsInfo.value; customGoods = BytedeskUtils.goodsInfo.value;
print('BytedeskUtils.goodsInfo.value'+BytedeskUtils.goodsInfo.value); print('BytedeskUtils.goodsInfo.value'+BytedeskUtils.goodsInfo.value);
_goodsSubmitted(); _goodsSubmitted();
} }
@override @override
void initState() { void initState() {
BytedeskUtils.goodsInfo.addListener(() { BytedeskUtils.goodsInfo.addListener(
submit
submit; );
});
if(widget.btnBack==null){ if(widget.btnBack==null){
@ -1555,7 +1549,7 @@ class _ChatKFPageState extends State<ChatKFPage>
_debounce?.cancel(); _debounce?.cancel();
_loadHistoryTimer?.cancel(); _loadHistoryTimer?.cancel();
_resendTimer?.cancel(); _resendTimer?.cancel();
BytedeskUtils.goodsInfo.removeListener(() { submit;}); BytedeskUtils.goodsInfo.removeListener( submit);
// bytedeskEventBus.destroy(); // FIXME: destroy // bytedeskEventBus.destroy(); // FIXME: destroy
super.dispose(); super.dispose();
} }

Loading…
Cancel
Save