sendImageMessage static method

Future<bool> sendImageMessage({
  1. bool isSendDing = false,
  2. String? picUrl,
  3. String? picPath,
})

picUrl is necessary on IOS 分享图片(IOS端必传picUrl)

Implementation

static Future<bool> sendImageMessage(
    {bool isSendDing = false, String? picUrl, String? picPath}) async {
  //必传一个
  if (picUrl == null && picPath == null) {
    return false;
  }
  bool result = false;
  try {
    result = await _channel.invokeMethod('sendImageMessage', {
      "picUrl": picUrl,
      "isSendDing": isSendDing,
      'picPath': picPath,
    });
  } catch (e) {
    print(e);
  }
  return result;
}