saveLastMsg static method

Future<bool> saveLastMsg(
  1. String pk,
  2. IMMessage? msg
)

IM 保存与对方聊天的最后一条消息

Implementation

static Future<bool> saveLastMsg(String pk, IMMessage? msg) {
  if (msg == null) {
    return _spf!.remove('im_$pk');
  } else {
    return _spf!.setString('im_$pk', msg.toString());
  }
}