Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a9f2e267cf | ||
|
|
642cc61a2e | ||
|
|
de8c192055 | ||
|
|
05cb6c430c | ||
|
|
b07d104799 | ||
|
|
207e0807e9 | ||
|
|
373e4ddc82 | ||
|
|
b3c0b16092 | ||
|
|
8c50207f7c | ||
|
|
3bf9570d8d | ||
|
|
2a8a6ff7d9 | ||
|
|
9c8b9990c9 | ||
|
|
705863ba66 | ||
|
|
fd39b328bc | ||
|
|
90b96cb413 | ||
|
|
7894327b2c | ||
|
|
96e90d3c0a |
@@ -1,5 +1,6 @@
|
|||||||
# flutter_openim_sdk
|
# flutter_openim_sdk
|
||||||

|
<img src="https://openim-1253691595.cos.ap-nanjing.myqcloud.com/WechatIMG20.jpeg" alt="image" style="width: 200px; " />
|
||||||
|
|
||||||
[](https://pub.flutter-io.cn/packages/flutter_openim_sdk)
|
[](https://pub.flutter-io.cn/packages/flutter_openim_sdk)
|
||||||
[](https://pub.dev/packages/flutter_openim_sdk)
|
[](https://pub.dev/packages/flutter_openim_sdk)
|
||||||
[](https://github.com/OpenIMSDK/Open-IM-SDK-Flutter/blob/main/LICENSE)
|
[](https://github.com/OpenIMSDK/Open-IM-SDK-Flutter/blob/main/LICENSE)
|
||||||
@@ -10,7 +11,7 @@ A flutter im plugin for android and ios.
|
|||||||
|
|
||||||
扫描下方二维码即可体验SDK调用示例 Demo
|
扫描下方二维码即可体验SDK调用示例 Demo
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,5 @@ android {
|
|||||||
dependencies {
|
dependencies {
|
||||||
// 本地依赖,现将aar复制到libs/io/openim/core-sdk/0.0.1/ 下,命名core-sdk-0.0.1.aar
|
// 本地依赖,现将aar复制到libs/io/openim/core-sdk/0.0.1/ 下,命名core-sdk-0.0.1.aar
|
||||||
// implementation 'io.openim:core-sdk:0.0.1@aar'
|
// implementation 'io.openim:core-sdk:0.0.1@aar'
|
||||||
// api 'io.openim:core-sdk:2.3.5-t44@aar'
|
implementation 'io.openim:core-sdk:3.2.0@aar'
|
||||||
implementation 'io.openim:core-sdk:3.0.0@aar'
|
|
||||||
}
|
}
|
||||||
@@ -19,7 +19,7 @@ public class OnUploadFileListener implements UploadFileCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void complete(long size, String url, int type) {
|
public void complete(long size, String url, long type) {
|
||||||
if (null != id) {
|
if (null != id) {
|
||||||
final Map<String, Object> values = new ArrayMap<>();
|
final Map<String, Object> values = new ArrayMap<>();
|
||||||
values.put("id", id);
|
values.put("id", id);
|
||||||
@@ -42,7 +42,7 @@ public class OnUploadFileListener implements UploadFileCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void hashPartProgress(int index, long size, String partHash) {
|
public void hashPartProgress(long index, long size, String partHash) {
|
||||||
if (null != id) {
|
if (null != id) {
|
||||||
final Map<String, Object> values = new ArrayMap<>();
|
final Map<String, Object> values = new ArrayMap<>();
|
||||||
values.put("id", id);
|
values.put("id", id);
|
||||||
@@ -64,7 +64,7 @@ public class OnUploadFileListener implements UploadFileCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void partSize(long partSize, int num) {
|
public void partSize(long partSize, long num) {
|
||||||
if (null != id) {
|
if (null != id) {
|
||||||
final Map<String, Object> values = new ArrayMap<>();
|
final Map<String, Object> values = new ArrayMap<>();
|
||||||
values.put("id", id);
|
values.put("id", id);
|
||||||
@@ -97,7 +97,7 @@ public class OnUploadFileListener implements UploadFileCallback {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void uploadPartComplete(int index, long partSize, String partHash) {
|
public void uploadPartComplete(long index, long partSize, String partHash) {
|
||||||
if (null != id) {
|
if (null != id) {
|
||||||
final Map<String, Object> values = new ArrayMap<>();
|
final Map<String, Object> values = new ArrayMap<>();
|
||||||
values.put("id", id);
|
values.put("id", id);
|
||||||
|
|||||||
@@ -8,4 +8,9 @@ public class OnUserListener implements open_im_sdk_callback.OnUserListener {
|
|||||||
public void onSelfInfoUpdated(String s) {
|
public void onSelfInfoUpdated(String s) {
|
||||||
CommonUtil.emitEvent("userListener", "onSelfInfoUpdated", s);
|
CommonUtil.emitEvent("userListener", "onSelfInfoUpdated", s);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onUserStatusChanged(String s) {
|
||||||
|
CommonUtil.emitEvent("userListener", "onUserStatusChanged", s);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,6 +20,10 @@ public class IMManager extends BaseManager {
|
|||||||
CommonUtil.runMainThreadReturn(result, initialized);
|
CommonUtil.runMainThreadReturn(result, initialized);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void unInitSDK(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
|
Open_im_sdk.unInitSDK(value(methodCall, "operationID"));
|
||||||
|
}
|
||||||
|
|
||||||
public void login(MethodCall methodCall, MethodChannel.Result result) {
|
public void login(MethodCall methodCall, MethodChannel.Result result) {
|
||||||
Open_im_sdk.login(
|
Open_im_sdk.login(
|
||||||
new OnBaseListener(result, methodCall),
|
new OnBaseListener(result, methodCall),
|
||||||
|
|||||||
@@ -75,7 +75,7 @@ public class ConversationManager: BaseServiceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func setConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[jsonString: "conversationID"], methodCall[int: "status"])
|
Open_im_sdkSetConversationRecvMessageOpt(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "conversationID"], methodCall[int: "status"])
|
||||||
}
|
}
|
||||||
|
|
||||||
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func getConversationRecvMessageOpt(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ public class IMMananger: BaseServiceManager {
|
|||||||
public override func registerHandlers() {
|
public override func registerHandlers() {
|
||||||
super.registerHandlers()
|
super.registerHandlers()
|
||||||
self["initSDK"] = initSDK
|
self["initSDK"] = initSDK
|
||||||
|
self["unInitSDK"] = unInitSDK
|
||||||
self["login"] = login
|
self["login"] = login
|
||||||
self["logout"] = logout
|
self["logout"] = logout
|
||||||
self["getLoginStatus"] = getLoginStatus
|
self["getLoginStatus"] = getLoginStatus
|
||||||
@@ -59,9 +60,13 @@ public class IMMananger: BaseServiceManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
func initSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
callBack(result,Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString()))
|
callBack(result, Open_im_sdkInitSDK(ConnListener(channel: self.channel), methodCall[string: "operationID"], methodCall.toJsonString()))
|
||||||
addObservers()
|
addObservers()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func unInitSDK(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
|
||||||
|
Open_im_sdkUnInitSDK(methodCall[string: "operationID"])
|
||||||
|
}
|
||||||
|
|
||||||
func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
func login(methodCall: FlutterMethodCall, result: @escaping FlutterResult) {
|
||||||
Open_im_sdkLogin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "token"])
|
Open_im_sdkLogin(BaseCallback(result: result), methodCall[string: "operationID"], methodCall[string: "userID"], methodCall[string: "token"])
|
||||||
@@ -129,8 +134,7 @@ public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbac
|
|||||||
self.channel = channel
|
self.channel = channel
|
||||||
self.id = id
|
self.id = id
|
||||||
}
|
}
|
||||||
|
public func complete(_ size: Int64, url: String?, typ: Int) {
|
||||||
public func complete(_ size: Int64, url: String?, typ: Int32) {
|
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
values["id"] = id
|
values["id"] = id
|
||||||
values["size"] = size
|
values["size"] = size
|
||||||
@@ -147,7 +151,7 @@ public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbac
|
|||||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "hashPartComplete", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "hashPartComplete", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func hashPartProgress(_ index: Int32, size: Int64, partHash: String?) {
|
public func hashPartProgress(_ index: Int, size: Int64, partHash: String?) {
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
values["id"] = id
|
values["id"] = id
|
||||||
values["index"] = index
|
values["index"] = index
|
||||||
@@ -163,7 +167,7 @@ public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbac
|
|||||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "open", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "open", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func partSize(_ partSize: Int64, num: Int32) {
|
public func partSize(_ partSize: Int64, num: Int) {
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
values["id"] = id
|
values["id"] = id
|
||||||
values["partSize"] = partSize
|
values["partSize"] = partSize
|
||||||
@@ -187,7 +191,7 @@ public class UploadFileListener: NSObject, Open_im_sdk_callbackUploadFileCallbac
|
|||||||
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "uploadID", errCode: nil, errMsg: nil, data: values)
|
CommonUtil.emitEvent(channel: channel, method: "uploadFileListener", type: "uploadID", errCode: nil, errMsg: nil, data: values)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func uploadPartComplete(_ index: Int32, partSize: Int64, partHash: String?) {
|
public func uploadPartComplete(_ index: Int, partSize: Int64, partHash: String?) {
|
||||||
var values: [String: Any] = [:]
|
var values: [String: Any] = [:]
|
||||||
values["id"] = id
|
values["id"] = id
|
||||||
values["index"] = index
|
values["index"] = index
|
||||||
|
|||||||
@@ -40,4 +40,9 @@ public class UserListener: NSObject, Open_im_sdk_callbackOnUserListenerProtocol
|
|||||||
public func onSelfInfoUpdated(_ userInfo: String?) {
|
public func onSelfInfoUpdated(_ userInfo: String?) {
|
||||||
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
|
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onSelfInfoUpdated", errCode: nil, errMsg: nil, data: userInfo)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public func onUserStatusChanged(_ userInfo: String?) {
|
||||||
|
CommonUtil.emitEvent(channel: self.channel, method: "userListener", type: "onUserStatusChanged", errCode: nil, errMsg: nil, data: userInfo)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ A new Flutter project.
|
|||||||
s.dependency 'Flutter'
|
s.dependency 'Flutter'
|
||||||
s.platform = :ios, '11.0'
|
s.platform = :ios, '11.0'
|
||||||
|
|
||||||
s.dependency 'OpenIMSDKCore','3.0.0'
|
s.dependency 'OpenIMSDKCore','3.2.0'
|
||||||
s.static_framework = true
|
s.static_framework = true
|
||||||
# s.vendored_frameworks = 'Framework/*.framework'
|
# s.vendored_frameworks = 'Framework/*.framework'
|
||||||
# Flutter.framework does not contain a i386 slice.
|
# Flutter.framework does not contain a i386 slice.
|
||||||
|
|||||||
@@ -33,9 +33,7 @@ export 'src/models/group_info.dart';
|
|||||||
export 'src/models/meeting_info.dart';
|
export 'src/models/meeting_info.dart';
|
||||||
export 'src/models/message.dart';
|
export 'src/models/message.dart';
|
||||||
export 'src/models/notification_info.dart';
|
export 'src/models/notification_info.dart';
|
||||||
export 'src/models/organization_info.dart';
|
|
||||||
export 'src/models/search_info.dart';
|
export 'src/models/search_info.dart';
|
||||||
export 'src/models/signaling_info.dart';
|
|
||||||
export 'src/models/user_info.dart';
|
export 'src/models/user_info.dart';
|
||||||
export 'src/openim.dart';
|
export 'src/openim.dart';
|
||||||
export 'src/utils.dart';
|
export 'src/utils.dart';
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
|||||||
class OnUserListener {
|
class OnUserListener {
|
||||||
/// The information of the logged-in user has been updated
|
/// The information of the logged-in user has been updated
|
||||||
Function(UserInfo info)? onSelfInfoUpdated;
|
Function(UserInfo info)? onSelfInfoUpdated;
|
||||||
|
Function(UserStatusInfo info)? onUserStatusChanged;
|
||||||
|
|
||||||
OnUserListener({this.onSelfInfoUpdated});
|
OnUserListener({this.onSelfInfoUpdated});
|
||||||
|
|
||||||
@@ -11,4 +12,8 @@ class OnUserListener {
|
|||||||
void selfInfoUpdated(UserInfo info) {
|
void selfInfoUpdated(UserInfo info) {
|
||||||
onSelfInfoUpdated?.call(info);
|
onSelfInfoUpdated?.call(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void userStatusChanged(UserStatusInfo info) {
|
||||||
|
onUserStatusChanged?.call(info);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -63,29 +63,29 @@ class IMManager {
|
|||||||
userInfo = Utils.toObj(data, (map) => UserInfo.fromJson(map));
|
userInfo = Utils.toObj(data, (map) => UserInfo.fromJson(map));
|
||||||
userManager.listener.selfInfoUpdated(userInfo);
|
userManager.listener.selfInfoUpdated(userInfo);
|
||||||
break;
|
break;
|
||||||
|
case 'onUserStatusChanged':
|
||||||
|
final status = Utils.toObj(data, (map) => UserStatusInfo.fromJson(map));
|
||||||
|
userManager.listener.userStatusChanged(status);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
} else if (call.method == ListenerType.groupListener) {
|
} else if (call.method == ListenerType.groupListener) {
|
||||||
String type = call.arguments['type'];
|
String type = call.arguments['type'];
|
||||||
dynamic data = call.arguments['data'];
|
dynamic data = call.arguments['data'];
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'onGroupApplicationAccepted':
|
case 'onGroupApplicationAccepted':
|
||||||
final i = Utils.toObj(
|
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
|
||||||
groupManager.listener.groupApplicationAccepted(i);
|
groupManager.listener.groupApplicationAccepted(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupApplicationAdded':
|
case 'onGroupApplicationAdded':
|
||||||
final i = Utils.toObj(
|
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
|
||||||
groupManager.listener.groupApplicationAdded(i);
|
groupManager.listener.groupApplicationAdded(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupApplicationDeleted':
|
case 'onGroupApplicationDeleted':
|
||||||
final i = Utils.toObj(
|
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
|
||||||
groupManager.listener.groupApplicationDeleted(i);
|
groupManager.listener.groupApplicationDeleted(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupApplicationRejected':
|
case 'onGroupApplicationRejected':
|
||||||
final i = Utils.toObj(
|
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
|
||||||
groupManager.listener.groupApplicationRejected(i);
|
groupManager.listener.groupApplicationRejected(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupDismissed':
|
case 'onGroupDismissed':
|
||||||
@@ -97,18 +97,15 @@ class IMManager {
|
|||||||
groupManager.listener.groupInfoChanged(i);
|
groupManager.listener.groupInfoChanged(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupMemberAdded':
|
case 'onGroupMemberAdded':
|
||||||
final i =
|
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||||
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
|
||||||
groupManager.listener.groupMemberAdded(i);
|
groupManager.listener.groupMemberAdded(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupMemberDeleted':
|
case 'onGroupMemberDeleted':
|
||||||
final i =
|
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||||
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
|
||||||
groupManager.listener.groupMemberDeleted(i);
|
groupManager.listener.groupMemberDeleted(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupMemberInfoChanged':
|
case 'onGroupMemberInfoChanged':
|
||||||
final i =
|
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
||||||
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
|
|
||||||
groupManager.listener.groupMemberInfoChanged(i);
|
groupManager.listener.groupMemberInfoChanged(i);
|
||||||
break;
|
break;
|
||||||
case 'onJoinedGroupAdded':
|
case 'onJoinedGroupAdded':
|
||||||
@@ -136,36 +133,31 @@ class IMManager {
|
|||||||
break;
|
break;
|
||||||
case 'onRecvC2CReadReceipt':
|
case 'onRecvC2CReadReceipt':
|
||||||
var value = call.arguments['data']['msgReceiptList'];
|
var value = call.arguments['data']['msgReceiptList'];
|
||||||
var list =
|
var list = Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||||
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
|
||||||
messageManager.msgListener.recvC2CReadReceipt(list);
|
messageManager.msgListener.recvC2CReadReceipt(list);
|
||||||
break;
|
break;
|
||||||
case 'onRecvGroupReadReceipt':
|
case 'onRecvGroupReadReceipt':
|
||||||
var value = call.arguments['data']['groupMsgReceiptList'];
|
var value = call.arguments['data']['groupMsgReceiptList'];
|
||||||
var list =
|
var list = Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
||||||
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
|
|
||||||
messageManager.msgListener.recvGroupReadReceipt(list);
|
messageManager.msgListener.recvGroupReadReceipt(list);
|
||||||
break;
|
break;
|
||||||
case 'onRecvMessageExtensionsAdded':
|
case 'onRecvMessageExtensionsAdded':
|
||||||
var msgID = call.arguments['data']['msgID'];
|
var msgID = call.arguments['data']['msgID'];
|
||||||
var value = call.arguments['data']['reactionExtensionList'];
|
var value = call.arguments['data']['reactionExtensionList'];
|
||||||
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
|
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
|
||||||
messageManager.msgListener
|
messageManager.msgListener.recvMessageExtensionsAdded(msgID, list);
|
||||||
.recvMessageExtensionsAdded(msgID, list);
|
|
||||||
break;
|
break;
|
||||||
case 'onRecvMessageExtensionsChanged':
|
case 'onRecvMessageExtensionsChanged':
|
||||||
var msgID = call.arguments['data']['msgID'];
|
var msgID = call.arguments['data']['msgID'];
|
||||||
var value = call.arguments['data']['reactionExtensionList'];
|
var value = call.arguments['data']['reactionExtensionList'];
|
||||||
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
|
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
|
||||||
messageManager.msgListener
|
messageManager.msgListener.recvMessageExtensionsChanged(msgID, list);
|
||||||
.recvMessageExtensionsChanged(msgID, list);
|
|
||||||
break;
|
break;
|
||||||
case 'onRecvMessageExtensionsDeleted':
|
case 'onRecvMessageExtensionsDeleted':
|
||||||
var msgID = call.arguments['data']['msgID'];
|
var msgID = call.arguments['data']['msgID'];
|
||||||
var value = call.arguments['data']['reactionExtensionKeyList'];
|
var value = call.arguments['data']['reactionExtensionKeyList'];
|
||||||
var list = Utils.toList(value, (map) => '$map');
|
var list = Utils.toList(value, (map) => '$map');
|
||||||
messageManager.msgListener
|
messageManager.msgListener.recvMessageExtensionsDeleted(msgID, list);
|
||||||
.recvMessageExtensionsDeleted(msgID, list);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'onRecvNewMessage':
|
case 'onRecvNewMessage':
|
||||||
@@ -207,18 +199,15 @@ class IMManager {
|
|||||||
conversationManager.listener.syncServerFailed();
|
conversationManager.listener.syncServerFailed();
|
||||||
break;
|
break;
|
||||||
case 'onNewConversation':
|
case 'onNewConversation':
|
||||||
var list =
|
var list = Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
||||||
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
|
||||||
conversationManager.listener.newConversation(list);
|
conversationManager.listener.newConversation(list);
|
||||||
break;
|
break;
|
||||||
case 'onConversationChanged':
|
case 'onConversationChanged':
|
||||||
var list =
|
var list = Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
||||||
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
|
|
||||||
conversationManager.listener.conversationChanged(list);
|
conversationManager.listener.conversationChanged(list);
|
||||||
break;
|
break;
|
||||||
case 'onTotalUnreadMessageCountChanged':
|
case 'onTotalUnreadMessageCountChanged':
|
||||||
conversationManager.listener
|
conversationManager.listener.totalUnreadMessageCountChanged(data ?? 0);
|
||||||
.totalUnreadMessageCountChanged(data ?? 0);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (call.method == ListenerType.friendListener) {
|
} else if (call.method == ListenerType.friendListener) {
|
||||||
@@ -239,23 +228,19 @@ class IMManager {
|
|||||||
friendshipManager.listener.friendAdded(u);
|
friendshipManager.listener.friendAdded(u);
|
||||||
break;
|
break;
|
||||||
case 'onFriendApplicationAccepted':
|
case 'onFriendApplicationAccepted':
|
||||||
final u = Utils.toObj(
|
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
|
||||||
friendshipManager.listener.friendApplicationAccepted(u);
|
friendshipManager.listener.friendApplicationAccepted(u);
|
||||||
break;
|
break;
|
||||||
case 'onFriendApplicationAdded':
|
case 'onFriendApplicationAdded':
|
||||||
final u = Utils.toObj(
|
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
|
||||||
friendshipManager.listener.friendApplicationAdded(u);
|
friendshipManager.listener.friendApplicationAdded(u);
|
||||||
break;
|
break;
|
||||||
case 'onFriendApplicationDeleted':
|
case 'onFriendApplicationDeleted':
|
||||||
final u = Utils.toObj(
|
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
|
||||||
friendshipManager.listener.friendApplicationDeleted(u);
|
friendshipManager.listener.friendApplicationDeleted(u);
|
||||||
break;
|
break;
|
||||||
case 'onFriendApplicationRejected':
|
case 'onFriendApplicationRejected':
|
||||||
final u = Utils.toObj(
|
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
|
||||||
friendshipManager.listener.friendApplicationRejected(u);
|
friendshipManager.listener.friendApplicationRejected(u);
|
||||||
break;
|
break;
|
||||||
case 'onFriendDeleted':
|
case 'onFriendDeleted':
|
||||||
@@ -272,8 +257,7 @@ class IMManager {
|
|||||||
String data = call.arguments['data'];
|
String data = call.arguments['data'];
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'onRecvCustomBusinessMessage':
|
case 'onRecvCustomBusinessMessage':
|
||||||
messageManager.customBusinessListener
|
messageManager.customBusinessListener?.recvCustomBusinessMessage(data);
|
||||||
?.recvCustomBusinessMessage(data);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} else if (call.method == ListenerType.messageKvInfoListener) {
|
} else if (call.method == ListenerType.messageKvInfoListener) {
|
||||||
@@ -281,8 +265,7 @@ class IMManager {
|
|||||||
String data = call.arguments['data'];
|
String data = call.arguments['data'];
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'onMessageKvInfoChanged':
|
case 'onMessageKvInfoChanged':
|
||||||
final list =
|
final list = Utils.toList(data, (map) => MessageKv.fromJson(map)).toList();
|
||||||
Utils.toList(data, (map) => MessageKv.fromJson(map)).toList();
|
|
||||||
messageManager.messageKvInfoListener?.messageKvInfoChanged(list);
|
messageManager.messageKvInfoListener?.messageKvInfoChanged(list);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -291,23 +274,19 @@ class IMManager {
|
|||||||
String data = call.arguments['data'];
|
String data = call.arguments['data'];
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 'onFriendApplicationAccepted':
|
case 'onFriendApplicationAccepted':
|
||||||
final u = Utils.toObj(
|
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
|
||||||
_listenerForService?.friendApplicationAccepted(u);
|
_listenerForService?.friendApplicationAccepted(u);
|
||||||
break;
|
break;
|
||||||
case 'onFriendApplicationAdded':
|
case 'onFriendApplicationAdded':
|
||||||
final u = Utils.toObj(
|
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
|
||||||
data, (map) => FriendApplicationInfo.fromJson(map));
|
|
||||||
_listenerForService?.friendApplicationAdded(u);
|
_listenerForService?.friendApplicationAdded(u);
|
||||||
break;
|
break;
|
||||||
case 'onGroupApplicationAccepted':
|
case 'onGroupApplicationAccepted':
|
||||||
final i = Utils.toObj(
|
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
|
||||||
_listenerForService?.groupApplicationAccepted(i);
|
_listenerForService?.groupApplicationAccepted(i);
|
||||||
break;
|
break;
|
||||||
case 'onGroupApplicationAdded':
|
case 'onGroupApplicationAdded':
|
||||||
final i = Utils.toObj(
|
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
|
||||||
data, (map) => GroupApplicationInfo.fromJson(map));
|
|
||||||
_listenerForService?.groupApplicationAdded(i);
|
_listenerForService?.groupApplicationAdded(i);
|
||||||
break;
|
break;
|
||||||
case 'onRecvNewMessage':
|
case 'onRecvNewMessage':
|
||||||
@@ -355,8 +334,7 @@ class IMManager {
|
|||||||
int fileSize = data['fileSize'];
|
int fileSize = data['fileSize'];
|
||||||
int streamSize = data['streamSize'];
|
int streamSize = data['streamSize'];
|
||||||
int storageSize = data['storageSize'];
|
int storageSize = data['storageSize'];
|
||||||
_uploadFileListener?.uploadProgress(
|
_uploadFileListener?.uploadProgress(id, fileSize, streamSize, storageSize);
|
||||||
id, fileSize, streamSize, storageSize);
|
|
||||||
break;
|
break;
|
||||||
case 'uploadID':
|
case 'uploadID':
|
||||||
String id = data['id'];
|
String id = data['id'];
|
||||||
@@ -368,14 +346,12 @@ class IMManager {
|
|||||||
int index = data['index'];
|
int index = data['index'];
|
||||||
int partSize = data['partSize'];
|
int partSize = data['partSize'];
|
||||||
String partHash = data['partHash'];
|
String partHash = data['partHash'];
|
||||||
_uploadFileListener?.uploadPartComplete(
|
_uploadFileListener?.uploadPartComplete(id, index, partSize, partHash);
|
||||||
id, index, partSize, partHash);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (error, stackTrace) {
|
} catch (error, stackTrace) {
|
||||||
Logger.print(
|
Logger.print("回调失败了。${call.method} ${call.arguments['type']} ${call.arguments['data']} $error $stackTrace");
|
||||||
"回调失败了。${call.method} ${call.arguments['type']} ${call.arguments['data']} $error $stackTrace");
|
|
||||||
}
|
}
|
||||||
return Future.value(null);
|
return Future.value(null);
|
||||||
});
|
});
|
||||||
@@ -428,6 +404,11 @@ class IMManager {
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// 反初始化SDK
|
||||||
|
Future<dynamic> unInitSDK() {
|
||||||
|
return _channel.invokeMethod('unInitSDK', _buildParam({}));
|
||||||
|
}
|
||||||
|
|
||||||
/// 登录
|
/// 登录
|
||||||
/// [userID] 用户id
|
/// [userID] 用户id
|
||||||
/// [token] 登录token,从业务服务器上获取
|
/// [token] 登录token,从业务服务器上获取
|
||||||
|
|||||||
@@ -1,381 +0,0 @@
|
|||||||
/// 部门信息
|
|
||||||
class DeptInfo {
|
|
||||||
/// 部门id
|
|
||||||
String? departmentID;
|
|
||||||
|
|
||||||
/// 头像
|
|
||||||
String? faceURL;
|
|
||||||
|
|
||||||
/// 显示名
|
|
||||||
String? name;
|
|
||||||
|
|
||||||
/// 上一级部门id
|
|
||||||
String? parentID;
|
|
||||||
|
|
||||||
/// 排序方式
|
|
||||||
int? order;
|
|
||||||
|
|
||||||
/// 部门类型
|
|
||||||
int? departmentType;
|
|
||||||
|
|
||||||
/// 创建时间
|
|
||||||
int? createTime;
|
|
||||||
|
|
||||||
/// 子部门数量
|
|
||||||
int? subDepartmentNum;
|
|
||||||
|
|
||||||
/// 成员数量
|
|
||||||
int? memberNum;
|
|
||||||
|
|
||||||
/// 扩展字段
|
|
||||||
String? ex;
|
|
||||||
|
|
||||||
/// 附加信息
|
|
||||||
String? attachedInfo;
|
|
||||||
|
|
||||||
String? relatedGroupID;
|
|
||||||
|
|
||||||
DeptInfo(
|
|
||||||
{this.departmentID,
|
|
||||||
this.faceURL,
|
|
||||||
this.name,
|
|
||||||
this.parentID,
|
|
||||||
this.order,
|
|
||||||
this.departmentType,
|
|
||||||
this.createTime,
|
|
||||||
this.subDepartmentNum,
|
|
||||||
this.memberNum,
|
|
||||||
this.ex,
|
|
||||||
this.attachedInfo,
|
|
||||||
this.relatedGroupID});
|
|
||||||
|
|
||||||
DeptInfo.fromJson(Map<String, dynamic> json) {
|
|
||||||
departmentID = json['departmentID'];
|
|
||||||
faceURL = json['faceURL'];
|
|
||||||
name = json['name'];
|
|
||||||
parentID = json['parentID'];
|
|
||||||
order = json['order'];
|
|
||||||
departmentType = json['departmentType'];
|
|
||||||
createTime = json['createTime'];
|
|
||||||
subDepartmentNum = json['subDepartmentNum'];
|
|
||||||
memberNum = json['memberNum'];
|
|
||||||
ex = json['ex'];
|
|
||||||
attachedInfo = json['attachedInfo'];
|
|
||||||
relatedGroupID = json['relatedGroupID'];
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final data = Map<String, dynamic>();
|
|
||||||
data['departmentID'] = this.departmentID;
|
|
||||||
data['faceURL'] = this.faceURL;
|
|
||||||
data['name'] = this.name;
|
|
||||||
data['parentID'] = this.parentID;
|
|
||||||
data['order'] = this.order;
|
|
||||||
data['departmentType'] = this.departmentType;
|
|
||||||
data['createTime'] = this.createTime;
|
|
||||||
data['subDepartmentNum'] = this.subDepartmentNum;
|
|
||||||
data['memberNum'] = this.memberNum;
|
|
||||||
data['ex'] = this.ex;
|
|
||||||
data['attachedInfo'] = this.attachedInfo;
|
|
||||||
data['relatedGroupID'] = this.relatedGroupID;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) =>
|
|
||||||
identical(this, other) ||
|
|
||||||
other is DeptInfo &&
|
|
||||||
runtimeType == other.runtimeType &&
|
|
||||||
departmentID == other.departmentID;
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode => departmentID.hashCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 部门成员信息
|
|
||||||
class DeptMemberInfo {
|
|
||||||
/// 用户id
|
|
||||||
String? userID;
|
|
||||||
|
|
||||||
/// 用户昵称
|
|
||||||
String? nickname;
|
|
||||||
|
|
||||||
/// 英文名
|
|
||||||
String? englishName;
|
|
||||||
|
|
||||||
/// 头像
|
|
||||||
String? faceURL;
|
|
||||||
|
|
||||||
/// 性别
|
|
||||||
int? gender;
|
|
||||||
|
|
||||||
/// 手机号
|
|
||||||
String? mobile;
|
|
||||||
|
|
||||||
/// 座机
|
|
||||||
String? telephone;
|
|
||||||
|
|
||||||
/// 出生时间
|
|
||||||
int? birth;
|
|
||||||
|
|
||||||
/// 邮箱
|
|
||||||
String? email;
|
|
||||||
|
|
||||||
/// 所在部门的id
|
|
||||||
String? departmentID;
|
|
||||||
|
|
||||||
/// 排序方式
|
|
||||||
int? order;
|
|
||||||
|
|
||||||
/// 职位
|
|
||||||
String? position;
|
|
||||||
|
|
||||||
/// 是否是领导
|
|
||||||
int? leader;
|
|
||||||
|
|
||||||
/// 状态
|
|
||||||
int? status;
|
|
||||||
|
|
||||||
/// 创建时间
|
|
||||||
int? createTime;
|
|
||||||
|
|
||||||
/// 入职时间
|
|
||||||
int? entryTime;
|
|
||||||
|
|
||||||
/// 离职时间
|
|
||||||
int? terminationTime;
|
|
||||||
|
|
||||||
/// 扩展字段
|
|
||||||
String? ex;
|
|
||||||
|
|
||||||
/// 附加信息
|
|
||||||
String? attachedInfo;
|
|
||||||
|
|
||||||
/// 搜索时使用
|
|
||||||
String? departmentName;
|
|
||||||
|
|
||||||
/// 所在部门的所有上级部门
|
|
||||||
List<DeptInfo>? parentDepartmentList;
|
|
||||||
|
|
||||||
/// 当前部门信息
|
|
||||||
DeptInfo? department;
|
|
||||||
|
|
||||||
DeptMemberInfo({
|
|
||||||
this.userID,
|
|
||||||
this.nickname,
|
|
||||||
this.englishName,
|
|
||||||
this.faceURL,
|
|
||||||
this.gender,
|
|
||||||
this.mobile,
|
|
||||||
this.telephone,
|
|
||||||
this.birth,
|
|
||||||
this.email,
|
|
||||||
this.departmentID,
|
|
||||||
this.order,
|
|
||||||
this.position,
|
|
||||||
this.leader,
|
|
||||||
this.status,
|
|
||||||
this.createTime,
|
|
||||||
this.ex,
|
|
||||||
this.attachedInfo,
|
|
||||||
this.departmentName,
|
|
||||||
this.parentDepartmentList,
|
|
||||||
this.department,
|
|
||||||
});
|
|
||||||
|
|
||||||
DeptMemberInfo.fromJson(Map<String, dynamic> json) {
|
|
||||||
userID = json['userID'];
|
|
||||||
nickname = json['nickname'];
|
|
||||||
englishName = json['englishName'];
|
|
||||||
faceURL = json['faceURL'];
|
|
||||||
gender = json['gender'];
|
|
||||||
mobile = json['mobile'];
|
|
||||||
telephone = json['telephone'];
|
|
||||||
birth = json['birth'];
|
|
||||||
email = json['email'];
|
|
||||||
departmentID = json['departmentID'];
|
|
||||||
order = json['order'];
|
|
||||||
position = json['position'];
|
|
||||||
leader = json['leader'];
|
|
||||||
status = json['status'];
|
|
||||||
createTime = json['createTime'];
|
|
||||||
ex = json['ex'];
|
|
||||||
attachedInfo = json['attachedInfo'];
|
|
||||||
departmentName = json['departmentName'];
|
|
||||||
if (json['parentDepartmentList'] != null) {
|
|
||||||
parentDepartmentList = <DeptInfo>[];
|
|
||||||
json['parentDepartmentList'].forEach((v) {
|
|
||||||
parentDepartmentList!.add(DeptInfo.fromJson(v));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
department = json['department'] == null
|
|
||||||
? null
|
|
||||||
: DeptInfo.fromJson(json['department']);
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final Map<String, dynamic> data = new Map<String, dynamic>();
|
|
||||||
data['userID'] = this.userID;
|
|
||||||
data['nickname'] = this.nickname;
|
|
||||||
data['englishName'] = this.englishName;
|
|
||||||
data['faceURL'] = this.faceURL;
|
|
||||||
data['gender'] = this.gender;
|
|
||||||
data['mobile'] = this.mobile;
|
|
||||||
data['telephone'] = this.telephone;
|
|
||||||
data['birth'] = this.birth;
|
|
||||||
data['email'] = this.email;
|
|
||||||
data['departmentID'] = this.departmentID;
|
|
||||||
data['order'] = this.order;
|
|
||||||
data['position'] = this.position;
|
|
||||||
data['leader'] = this.leader;
|
|
||||||
data['status'] = this.status;
|
|
||||||
data['createTime'] = this.createTime;
|
|
||||||
data['ex'] = this.ex;
|
|
||||||
data['attachedInfo'] = this.attachedInfo;
|
|
||||||
data['departmentName'] = this.departmentName;
|
|
||||||
if (this.parentDepartmentList != null) {
|
|
||||||
data['parentDepartmentList'] =
|
|
||||||
this.parentDepartmentList!.map((v) => v.toJson()).toList();
|
|
||||||
}
|
|
||||||
data['department'] = this.department?.toJson();
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
|
|
||||||
@override
|
|
||||||
bool operator ==(Object other) =>
|
|
||||||
identical(this, other) ||
|
|
||||||
other is DeptMemberInfo &&
|
|
||||||
runtimeType == other.runtimeType &&
|
|
||||||
userID == other.userID;
|
|
||||||
|
|
||||||
@override
|
|
||||||
int get hashCode => userID.hashCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 用户所在的部门
|
|
||||||
class UserInDept {
|
|
||||||
/// 部门信息
|
|
||||||
DeptInfo? department;
|
|
||||||
|
|
||||||
/// 所在部门自己的信息
|
|
||||||
DeptMemberInfo? member;
|
|
||||||
|
|
||||||
UserInDept({this.department, this.member});
|
|
||||||
|
|
||||||
UserInDept.fromJson(Map<String, dynamic> json) {
|
|
||||||
department = json['department'] != null
|
|
||||||
? DeptInfo.fromJson(json['department'])
|
|
||||||
: null;
|
|
||||||
member =
|
|
||||||
json['member'] != null ? DeptMemberInfo.fromJson(json['member']) : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final data = Map<String, dynamic>();
|
|
||||||
if (this.department != null) {
|
|
||||||
data['department'] = this.department!.toJson();
|
|
||||||
}
|
|
||||||
if (this.member != null) {
|
|
||||||
data['member'] = this.member!.toJson();
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 部门下的一级子部门跟员工
|
|
||||||
class DeptMemberAndSubDept {
|
|
||||||
/// 一级子部门
|
|
||||||
List<DeptInfo>? departmentList;
|
|
||||||
|
|
||||||
/// 一级成员
|
|
||||||
List<DeptMemberInfo>? departmentMemberList;
|
|
||||||
|
|
||||||
/// 当前部门的所有上一级部门
|
|
||||||
List<DeptInfo>? parentDepartmentList;
|
|
||||||
|
|
||||||
DeptMemberAndSubDept({
|
|
||||||
this.departmentList,
|
|
||||||
this.departmentMemberList,
|
|
||||||
this.parentDepartmentList,
|
|
||||||
});
|
|
||||||
|
|
||||||
DeptMemberAndSubDept.fromJson(Map<String, dynamic> json) {
|
|
||||||
if (json['departmentList'] != null) {
|
|
||||||
departmentList = <DeptInfo>[];
|
|
||||||
json['departmentList'].forEach((v) {
|
|
||||||
departmentList!.add(DeptInfo.fromJson(v));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (json['departmentMemberList'] != null) {
|
|
||||||
departmentMemberList = <DeptMemberInfo>[];
|
|
||||||
json['departmentMemberList'].forEach((v) {
|
|
||||||
departmentMemberList!.add(DeptMemberInfo.fromJson(v));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (json['parentDepartmentList'] != null) {
|
|
||||||
parentDepartmentList = <DeptInfo>[];
|
|
||||||
json['parentDepartmentList'].forEach((v) {
|
|
||||||
parentDepartmentList!.add(DeptInfo.fromJson(v));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final data = Map<String, dynamic>();
|
|
||||||
if (this.departmentList != null) {
|
|
||||||
data['departmentList'] =
|
|
||||||
this.departmentList!.map((v) => v.toJson()).toList();
|
|
||||||
}
|
|
||||||
if (this.departmentMemberList != null) {
|
|
||||||
data['departmentMemberList'] =
|
|
||||||
this.departmentMemberList!.map((v) => v.toJson()).toList();
|
|
||||||
}
|
|
||||||
if (this.parentDepartmentList != null) {
|
|
||||||
data['parentDepartmentList'] =
|
|
||||||
this.parentDepartmentList!.map((v) => v.toJson()).toList();
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 搜索结果
|
|
||||||
class OrganizationSearchResult {
|
|
||||||
/// 部门列表
|
|
||||||
List<DeptInfo>? departmentList;
|
|
||||||
|
|
||||||
/// 部门成员列表
|
|
||||||
List<DeptMemberInfo>? departmentMemberList;
|
|
||||||
|
|
||||||
OrganizationSearchResult({
|
|
||||||
this.departmentList,
|
|
||||||
this.departmentMemberList,
|
|
||||||
});
|
|
||||||
|
|
||||||
OrganizationSearchResult.fromJson(Map<String, dynamic> json) {
|
|
||||||
if (json['departmentList'] != null) {
|
|
||||||
departmentList = <DeptInfo>[];
|
|
||||||
json['departmentList'].forEach((v) {
|
|
||||||
departmentList!.add(DeptInfo.fromJson(v));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if (json['departmentMemberList'] != null) {
|
|
||||||
departmentMemberList = <DeptMemberInfo>[];
|
|
||||||
json['departmentMemberList'].forEach((v) {
|
|
||||||
departmentMemberList!.add(DeptMemberInfo.fromJson(v));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final data = Map<String, dynamic>();
|
|
||||||
if (this.departmentList != null) {
|
|
||||||
data['departmentList'] =
|
|
||||||
this.departmentList!.map((v) => v.toJson()).toList();
|
|
||||||
}
|
|
||||||
if (this.departmentMemberList != null) {
|
|
||||||
data['departmentMemberList'] =
|
|
||||||
this.departmentMemberList!.map((v) => v.toJson()).toList();
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,245 +0,0 @@
|
|||||||
import 'dart:io';
|
|
||||||
|
|
||||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
|
||||||
|
|
||||||
class SignalingInfo {
|
|
||||||
/// 操作者
|
|
||||||
String? userID;
|
|
||||||
|
|
||||||
/// 邀请信息
|
|
||||||
InvitationInfo? invitation;
|
|
||||||
|
|
||||||
/// 离线显示内容
|
|
||||||
OfflinePushInfo? offlinePushInfo;
|
|
||||||
|
|
||||||
SignalingInfo({
|
|
||||||
this.userID,
|
|
||||||
this.invitation,
|
|
||||||
this.offlinePushInfo,
|
|
||||||
});
|
|
||||||
|
|
||||||
SignalingInfo.fromJson(Map<String, dynamic> json) {
|
|
||||||
invitation = json['invitation'] == null
|
|
||||||
? null
|
|
||||||
: InvitationInfo.fromJson(json['invitation']);
|
|
||||||
offlinePushInfo = json['offlinePushInfo'] == null
|
|
||||||
? null
|
|
||||||
: OfflinePushInfo.fromJson(json['offlinePushInfo']);
|
|
||||||
userID = json['userID'] ?? invitation?.inviterUserID;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final data = Map<String, dynamic>();
|
|
||||||
data['userID'] = this.userID;
|
|
||||||
data['invitation'] = this.invitation?.toJson();
|
|
||||||
data['offlinePushInfo'] = this.offlinePushInfo?.toJson();
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class InvitationInfo {
|
|
||||||
/// 邀请者UserID
|
|
||||||
String? inviterUserID;
|
|
||||||
|
|
||||||
/// 被邀请者UserID列表,如果是单聊只有一个元素
|
|
||||||
List<String>? inviteeUserIDList;
|
|
||||||
|
|
||||||
/// 如果是单聊,为""
|
|
||||||
String? groupID;
|
|
||||||
|
|
||||||
/// 房间ID,必须唯一,可以不设置。
|
|
||||||
String? roomID;
|
|
||||||
|
|
||||||
/// 邀请超时时间(秒)
|
|
||||||
int? timeout;
|
|
||||||
|
|
||||||
/// 发起时间
|
|
||||||
int? initiateTime;
|
|
||||||
|
|
||||||
/// video 或者 audio
|
|
||||||
String? mediaType;
|
|
||||||
|
|
||||||
/// [ConversationType]1为单聊,2为群聊
|
|
||||||
int? sessionType;
|
|
||||||
|
|
||||||
/// 平台[Platform]
|
|
||||||
int? platformID;
|
|
||||||
|
|
||||||
InvitationInfo(
|
|
||||||
{this.inviterUserID,
|
|
||||||
this.inviteeUserIDList,
|
|
||||||
this.groupID,
|
|
||||||
this.roomID,
|
|
||||||
this.timeout,
|
|
||||||
this.initiateTime,
|
|
||||||
this.mediaType,
|
|
||||||
this.sessionType,
|
|
||||||
this.platformID});
|
|
||||||
|
|
||||||
InvitationInfo.fromJson(Map<String, dynamic> json) {
|
|
||||||
inviterUserID = json['inviterUserID'];
|
|
||||||
inviteeUserIDList = json['inviteeUserIDList']?.cast<String>();
|
|
||||||
groupID = json['groupID'];
|
|
||||||
roomID = json['roomID'];
|
|
||||||
timeout = json['timeout'];
|
|
||||||
initiateTime = json['initiateTime'];
|
|
||||||
mediaType = json['mediaType'];
|
|
||||||
sessionType = json['sessionType'];
|
|
||||||
platformID = json['platformID'];
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final data = Map<String, dynamic>();
|
|
||||||
data['inviterUserID'] = this.inviterUserID;
|
|
||||||
data['inviteeUserIDList'] = this.inviteeUserIDList;
|
|
||||||
data['groupID'] = this.groupID;
|
|
||||||
data['roomID'] = this.roomID;
|
|
||||||
data['timeout'] = this.timeout;
|
|
||||||
data['initiateTime'] = this.initiateTime;
|
|
||||||
data['mediaType'] = this.mediaType;
|
|
||||||
data['sessionType'] = this.sessionType;
|
|
||||||
data['platformID'] = this.platformID;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// 信令凭证
|
|
||||||
class SignalingCertificate {
|
|
||||||
/// 登录token
|
|
||||||
String? token;
|
|
||||||
|
|
||||||
/// 房间id
|
|
||||||
String? roomID;
|
|
||||||
|
|
||||||
/// 服务器地址
|
|
||||||
String? liveURL;
|
|
||||||
|
|
||||||
/// 占线列表
|
|
||||||
List<String>? busyLineUserIDList;
|
|
||||||
|
|
||||||
SignalingCertificate({
|
|
||||||
this.token,
|
|
||||||
this.roomID,
|
|
||||||
this.liveURL,
|
|
||||||
this.busyLineUserIDList,
|
|
||||||
});
|
|
||||||
|
|
||||||
SignalingCertificate.fromJson(Map<String, dynamic> json) {
|
|
||||||
token = json['token'];
|
|
||||||
roomID = json['roomID'];
|
|
||||||
liveURL = json['liveURL'];
|
|
||||||
busyLineUserIDList = null == json['busyLineUserIDList']
|
|
||||||
? null
|
|
||||||
: json['busyLineUserIDList'].cast<String>();
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final data = Map<String, dynamic>();
|
|
||||||
data['token'] = this.token;
|
|
||||||
data['roomID'] = this.roomID;
|
|
||||||
data['liveURL'] = this.liveURL;
|
|
||||||
data['busyLineUserIDList'] = this.busyLineUserIDList;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class RoomCallingInfo {
|
|
||||||
InvitationInfo? invitation;
|
|
||||||
List<Participant>? participant;
|
|
||||||
String? roomID;
|
|
||||||
String? token;
|
|
||||||
String? liveURL;
|
|
||||||
String? groupID;
|
|
||||||
|
|
||||||
RoomCallingInfo({
|
|
||||||
this.invitation,
|
|
||||||
this.participant,
|
|
||||||
this.roomID,
|
|
||||||
this.token,
|
|
||||||
this.liveURL,
|
|
||||||
this.groupID,
|
|
||||||
});
|
|
||||||
|
|
||||||
RoomCallingInfo.fromJson(Map<String, dynamic> json) {
|
|
||||||
invitation = json['invitation'] != null
|
|
||||||
? InvitationInfo.fromJson(json['invitation'])
|
|
||||||
: null;
|
|
||||||
if (json['participant'] != null) {
|
|
||||||
participant = <Participant>[];
|
|
||||||
json['participant'].forEach((v) {
|
|
||||||
participant!.add(Participant.fromJson(v));
|
|
||||||
});
|
|
||||||
}
|
|
||||||
roomID = json['roomID'] ?? invitation?.roomID;
|
|
||||||
token = json['token'];
|
|
||||||
liveURL = json['liveURL'];
|
|
||||||
groupID = json['groupID'];
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final data = Map<String, dynamic>();
|
|
||||||
if (this.invitation != null) {
|
|
||||||
data['invitation'] = this.invitation!.toJson();
|
|
||||||
}
|
|
||||||
if (this.participant != null) {
|
|
||||||
data['participant'] = this.participant!.map((v) => v.toJson()).toList();
|
|
||||||
}
|
|
||||||
data['roomID'] = this.roomID;
|
|
||||||
data['token'] = this.token;
|
|
||||||
data['liveURL'] = this.liveURL;
|
|
||||||
data['groupID'] = this.groupID;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class Participant {
|
|
||||||
GroupInfo? groupInfo;
|
|
||||||
GroupMembersInfo? groupMemberInfo;
|
|
||||||
UserInfo? userInfo;
|
|
||||||
|
|
||||||
Participant({this.groupInfo, this.groupMemberInfo, this.userInfo});
|
|
||||||
|
|
||||||
Participant.fromJson(Map<String, dynamic> json) {
|
|
||||||
groupInfo = json['groupInfo'] != null
|
|
||||||
? GroupInfo.fromJson(json['groupInfo'])
|
|
||||||
: null;
|
|
||||||
groupMemberInfo = json['groupMemberInfo'] != null
|
|
||||||
? GroupMembersInfo.fromJson(json['groupMemberInfo'])
|
|
||||||
: null;
|
|
||||||
userInfo =
|
|
||||||
json['userInfo'] != null ? UserInfo.fromJson(json['userInfo']) : null;
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final data = Map<String, dynamic>();
|
|
||||||
if (this.groupInfo != null) {
|
|
||||||
data['groupInfo'] = this.groupInfo!.toJson();
|
|
||||||
}
|
|
||||||
if (this.groupMemberInfo != null) {
|
|
||||||
data['groupMemberInfo'] = this.groupMemberInfo!.toJson();
|
|
||||||
}
|
|
||||||
if (this.userInfo != null) {
|
|
||||||
data['userInfo'] = this.userInfo!.toJson();
|
|
||||||
}
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
class CustomSignaling {
|
|
||||||
String? roomID;
|
|
||||||
String? customInfo;
|
|
||||||
|
|
||||||
CustomSignaling({this.roomID, this.customInfo});
|
|
||||||
|
|
||||||
CustomSignaling.fromJson(Map<String, dynamic> json) {
|
|
||||||
roomID = json['roomID'];
|
|
||||||
customInfo = json['customInfo'];
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, dynamic> toJson() {
|
|
||||||
final data = Map<String, dynamic>();
|
|
||||||
data['roomID'] = roomID;
|
|
||||||
data['customInfo'] = customInfo;
|
|
||||||
return data;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -551,3 +551,34 @@ class FriendApplicationInfo {
|
|||||||
/// 已拒绝
|
/// 已拒绝
|
||||||
bool get isRejected => handleResult == -1;
|
bool get isRejected => handleResult == -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
class UserStatusInfo {
|
||||||
|
/// 用户id
|
||||||
|
String? userID;
|
||||||
|
|
||||||
|
/// 状态
|
||||||
|
int? status;
|
||||||
|
|
||||||
|
/// 平台ID
|
||||||
|
List<int>? platformIDs;
|
||||||
|
|
||||||
|
UserStatusInfo({
|
||||||
|
this.userID,
|
||||||
|
this.status,
|
||||||
|
this.platformIDs,
|
||||||
|
});
|
||||||
|
|
||||||
|
UserStatusInfo.fromJson(Map<String, dynamic> json) {
|
||||||
|
userID = json['userID'];
|
||||||
|
status = json['status'];
|
||||||
|
platformIDs = json['platformIDs'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final data = Map<String, dynamic>();
|
||||||
|
data['userID'] = this.userID;
|
||||||
|
data['status'] = this.status;
|
||||||
|
data['platformIDs'] = this.platformIDs;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import 'package:flutter/services.dart';
|
|||||||
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
|
||||||
|
|
||||||
class OpenIM {
|
class OpenIM {
|
||||||
static const version = '3.0.0';
|
static const version = '3.2.0';
|
||||||
|
|
||||||
static const _channel = const MethodChannel('flutter_openim_sdk');
|
static const _channel = const MethodChannel('flutter_openim_sdk');
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
name: flutter_openim_sdk
|
name: flutter_openim_sdk
|
||||||
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
|
description: An instant messaging plug-in that supports Android and IOS. And the server is also all open source.
|
||||||
version: 3.0.0
|
version: 3.2.0
|
||||||
homepage: https://www.rentsoft.cn
|
homepage: https://www.rentsoft.cn
|
||||||
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter
|
repository: https://github.com/OpenIMSDK/Open-IM-SDK-Flutter
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user