E/MethodChannel#leancloud_plugin(11774): Failed to handle method call
E/MethodChannel#leancloud_plugin(11774): java.lang.NullPointerException: Attempt to invoke virtual method 'long java.lang.Long.longValue()' on a null object reference
E/MethodChannel#leancloud_plugin(11774): at cn.leancloud.plugin.Common.parseMessageIntervalBound(Common.java:276)
E/MethodChannel#leancloud_plugin(11774): at cn.leancloud.plugin.LeancloudPlugin.onMethodCall(LeancloudPlugin.java:623)
E/MethodChannel#leancloud_plugin(11774): at io.flutter.plugin.common.MethodChannel$IncomingMethodCallHandler.onMessage(MethodChannel.java:233)
E/MethodChannel#leancloud_plugin(11774): at io.flutter.embedding.engine.dart.DartMessenger.handleMessageFromDart(DartMessenger.java:85)
E/MethodChannel#leancloud_plugin(11774): at io.flutter.embedding.engine.FlutterJNI.handlePlatformMessage(FlutterJNI.java:818)
E/MethodChannel#leancloud_plugin(11774): at android.os.MessageQueue.nativePollOnce(Native Method)
E/MethodChannel#leancloud_plugin(11774): at android.os.MessageQueue.next(MessageQueue.java:336)
E/MethodChannel#leancloud_plugin(11774): at android.os.Looper.loop(Looper.java:181)
E/MethodChannel#leancloud_plugin(11774): at android.app.ActivityThread.main(ActivityThread.java:7551)
E/MethodChannel#leancloud_plugin(11774): at java.lang.reflect.Method.invoke(Native Method)
E/MethodChannel#leancloud_plugin(11774): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
E/MethodChannel#leancloud_plugin(11774): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
上面是报错信息。
下面是我的执行代码,ios不会报错
void moreMessage() {
_conversation
.queryMessage(startMessageID: widgets.last.message.id, direction: MessageQueryDirection.oldToNew)
.then((value) {
List msgIdList = widgets.map((e) => e.message.id).toList();
List msgList = value.where((element) => !msgIdList.contains(element.id)).toList();
if (msgList.isNotEmpty) {
List messageWidgets = msgList.reversed.map((e) => _getWidgetByMessage(e)).toList();
widgets.addAll(messageWidgets);
_chatSink.add(widgets);
} else {
ToastUtils.showToast("无更多消息");
}
}).catchError((e) {
LogUtil.e(e.toString());
ToastUtils.showToast("加载更多消息错误");
_chatSink.add(widgets);
});
}