pinInfo method

Future<MessagePinInfo?> pinInfo()

Implementation

Future<MessagePinInfo?> pinInfo() async {
  if (_msgId == null) {
    return null;
  }
  Map req = {"msgId": msgId};
  Map result = await _emMessageChannel.invokeMethod(
    ChatMethodKeys.getPinInfo,
    req,
  );
  try {
    EMError.hasErrorFromResult(result);
    if (result.containsKey(ChatMethodKeys.getPinInfo)) {
      return result.getValue<MessagePinInfo>(ChatMethodKeys.getPinInfo,
          callback: (obj) => MessagePinInfo.fromJson(obj));
    } else {
      return null;
    }
  } on EMError {
    rethrow;
  }
}