NIMMessage.locationEmptyMessage constructor Null safety

NIMMessage.locationEmptyMessage(
  1. {required String sessionId,
  2. required NIMSessionType sessionType,
  3. required double latitude,
  4. required double longitude,
  5. required String address}
)

Implementation

factory NIMMessage.locationEmptyMessage(
    {required String sessionId,
    required NIMSessionType sessionType,
    required double latitude,
    required double longitude,
    required String address}) {
  var locationAttachment = NIMLocationAttachment(
      latitude: latitude, longitude: longitude, address: address);

  return NIMMessage(
      messageDirection: NIMMessageDirection.outgoing,
      messageType: NIMMessageType.location,
      timestamp: new DateTime.now().millisecondsSinceEpoch,
      status: NIMMessageStatus.sending,
      sessionId: sessionId,
      sessionType: sessionType,
      messageAttachment: locationAttachment,
      attachmentStatus: NIMMessageAttachmentStatus.transferred);
}