EMMessage.createLocationSendMessage constructor Null safety

EMMessage.createLocationSendMessage(
  1. {required String targetId,
  2. required double latitude,
  3. required double longitude,
  4. String? address,
  5. String? buildingName}
)

Creates a location message for sending.

Param targetId The ID of the message recipient.

  • For a one-to-one chat, it is the username of the peer user.
  • For a group chat, it is the group ID.
  • For a chat room, it is the chat room ID.

Param latitude The latitude.

Param longitude The longitude.

Param address The address.

Param buildingName The building name.

Return The message instance.

Implementation

EMMessage.createLocationSendMessage({
  required String targetId,
  required double latitude,
  required double longitude,
  String? address,
  String? buildingName,
}) : this.createSendMessage(
          to: targetId,
          body: EMLocationMessageBody(
            latitude: latitude,
            longitude: longitude,
            address: address,
          ));