sendChatroomLocationMessage method Null safety
Send a location message in the chatroom.
Implementation
Future<NIMResult<NIMChatroomMessage>> sendChatroomLocationMessage({
required String roomId,
required double latitude,
required double longitude,
required String address,
bool resend = false,
ChatroomMessageAction? action,
}) async {
return _createMessage({
'roomId': roomId,
'latitude': latitude,
'longitude': longitude,
'address': address,
'messageType': 'location',
}).then((messageResult) async {
if (messageResult.isSuccess) {
final message = messageResult.data as NIMChatroomMessage;
await action?.call(message);
return sendChatroomMessage(message, resend);
} else {
return messageResult;
}
});
}