wechat_flutter
wechat_flutter copied to clipboard
推荐好友,疯狂点击添加会报错。
action(UserData model) {
addFriend(
model.identifier,
context,
suCc: (v) {
if (v) {
showToast(context, '添加成功');
sendTextMsg(model.identifier, 1, '你好${model.name},我添加你为好友啦');
Navigator.of(context).pop();
}
},
);
}
这时候的 Navigator.of(context).pop(); 不能这样写,因为有可能content已经销毁。
忘记改成跟添加好友那一样了