batchInsertMessage static method
Implementation
static Future<void> batchInsertMessage(List<Message> msgs, Function(bool? result, int? code)? finished) async {
List messageMaps = [];
for (Message message in msgs) {
Map messageMap = MessageFactory.instance!.message2Map(message);
messageMaps.add(messageMap);
}
Map map = {"messageMapList": messageMaps};
Map resultMap = await _channel.invokeMethod(RCMethodKey.BatchInsertMessage, map);
bool? result = resultMap["result"];
int? code = resultMap["code"];
if (finished != null) {
finished(result, code);
}
}