createImageMessage static method

Object createImageMessage({
  1. required String userID,
  2. required dynamic file,
  3. String convType = 'C2C',
  4. String cloudCustomData = '',
  5. bool needReadReceipt = false,
  6. required dynamic progressCallback,
  7. int priority = 0,
})

Implementation

static Object createImageMessage(
    {required String userID,
    required file,
    String convType = 'C2C',
    String cloudCustomData = '',
    bool needReadReceipt = false,
    required progressCallback,
    int priority = 0}) {
  final textParams = {
    "to": userID,
    "conversationType": convType,
    "cloudCustomData": cloudCustomData,
    "needReadReceipt": needReadReceipt,
    "priority": MessagePriorityWeb.convertMsgPriorityToWeb(priority),
    "payload": mapToJSObj({"file": file}),
    "onProgress": progressCallback
  };
  return mapToJSObj(textParams);
}