sendMessage method Null safety

Future<V2TimValueCallback<V2TimMessage>> sendMessage(
  1. {required String id,
  2. required String receiver,
  3. required String groupID,
  4. MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL,
  5. bool onlineUserOnly = false,
  6. bool isExcludedFromUnreadCount = false,
  7. bool needReadReceipt = false,
  8. OfflinePushInfo? offlinePushInfo,
  9. String? cloudCustomData,
  10. String? localCustomData}
)

Send message Parameters

The id	 message uniquely identifies
receiver	 the userID of the message recipient. If you are sending a C2C single-chat message, you only need to specify the receiver. 
groupID	target group ID, if you are sending group chat messages, you only need to specify groupID. 
priority	Message priority, only valid for group chat messages. Please set important messages to high priority (such as red envelopes, gift messages), and frequent and unimportant messages to low priority (such as like messages). 
onlineUserOnly	 Whether only online users can receive it, if it is set to true, the receiver's historical messages cannot be pulled. It is often used to implement weak prompts such as 'the other party is typing' or non-important prompts in groups. Field does not support AVChatRoom. 
offlinePushInfo	The title and content of offline push. 
needReadReceipt whether a read receipt is required for messages (only Group messages are valid, supported by version 6.1 and above, you need to purchase the Ultimate Edition package)

Implementation

Future<V2TimValueCallback<V2TimMessage>> sendMessage(
 {required String id, // ID created by myself
 required String receiver,
 required String groupID,
 MessagePriorityEnum priority = MessagePriorityEnum.V2TIM_PRIORITY_NORMAL, 
 bool onlineUserOnly = false,
 bool isExcludedFromUnreadCount = false,
 bool needReadReceipt = false,
 OfflinePushInfo? offlinePushInfo,
 String? cloudCustomData, // Add before message sending
 String? localCustomData}) async {
 return ImFlutterPlatform.instance.sendMessage(
 id: id,
 receiver: receiver,
 groupID: groupID,
 priority: EnumUtils.convertMessagePriorityEnum(priority) ,
 onlineUserOnly: onlineUserOnly,
 isExcludedFromUnreadCount: isExcludedFromUnreadCount,
 offlinePushInfo: offlinePushInfo?.toJson(),
 localCustomData: localCustomData,
 needReadReceipt: needReadReceipt,
 cloudCustomData: cloudCustomData);
}