feat: Optimize comments and field names.

main
std-s 2 years ago
parent cc6d164985
commit 627ee54a67
  1. 38
      .idea/libraries/Dart_SDK.xml
  2. 4
      .idea/libraries/Flutter_Plugins.xml
  3. 12
      android/src/main/java/io/openim/flutter_openim_sdk/listener/OnMessageKvInfoListener.java
  4. 119
      android/src/main/java/io/openim/flutter_openim_sdk/manager/MessageManager.java
  5. 25
      ios/Classes/Module/MessageManager.swift
  6. 12
      ios/Classes/SwiftFlutterOpenimSdkPlugin.swift
  7. 2
      lib/flutter_openim_sdk.dart
  8. 11
      lib/src/enum/conversation_type.dart
  9. 12
      lib/src/enum/group_at_type.dart
  10. 8
      lib/src/enum/group_role_level.dart
  11. 7
      lib/src/enum/group_type.dart
  12. 8
      lib/src/enum/group_verification.dart
  13. 9
      lib/src/enum/im_platform.dart
  14. 2
      lib/src/enum/listener_type.dart
  15. 10
      lib/src/enum/message_status.dart
  16. 126
      lib/src/enum/message_type.dart
  17. 121
      lib/src/enum/sdk_error_code.dart
  18. 28
      lib/src/listener/advanced_msg_listener.dart
  19. 12
      lib/src/listener/connect_listener.dart
  20. 12
      lib/src/listener/conversation_listener.dart
  21. 74
      lib/src/listener/friendship_listener.dart
  22. 22
      lib/src/listener/group_listener.dart
  23. 2
      lib/src/listener/listener_for_service.dart
  24. 11
      lib/src/listener/message_kv_info_listener.dart
  25. 4
      lib/src/listener/msg_send_progress_listener.dart
  26. 5
      lib/src/listener/user_listener.dart
  27. 130
      lib/src/manager/im_conversation_manager.dart
  28. 66
      lib/src/manager/im_friendship_manager.dart
  29. 282
      lib/src/manager/im_group_manager.dart
  30. 258
      lib/src/manager/im_manager.dart
  31. 333
      lib/src/manager/im_message_manager.dart
  32. 42
      lib/src/manager/im_user_manager.dart
  33. 54
      lib/src/models/conversation_info.dart
  34. 130
      lib/src/models/group_info.dart
  35. 155
      lib/src/models/meeting_info.dart
  36. 435
      lib/src/models/message.dart
  37. 27
      lib/src/models/notification_info.dart
  38. 16
      lib/src/models/search_info.dart
  39. 229
      lib/src/models/user_info.dart
  40. 36
      pubspec.lock

@ -1,25 +1,25 @@
<component name="libraryTable">
<library name="Dart SDK">
<CLASSES>
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/async" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/cli" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/collection" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/convert" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/core" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/developer" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/ffi" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/html" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/indexed_db" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/io" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/isolate" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/js" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/js_util" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/math" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/mirrors" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/svg" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/typed_data" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/web_audio" />
<root url="file://$USER_HOME$/Development/flutter/bin/cache/dart-sdk/lib/web_gl" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/async" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/cli" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/collection" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/convert" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/core" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/developer" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/ffi" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/html" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/indexed_db" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/io" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/isolate" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/js" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/js_util" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/math" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/mirrors" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/svg" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/typed_data" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/web_audio" />
<root url="file://$PROJECT_DIR$/../../../framework/flutter/bin/cache/dart-sdk/lib/web_gl" />
</CLASSES>
<JAVADOC />
<SOURCES />

@ -1,8 +1,6 @@
<component name="libraryTable">
<library name="Flutter Plugins" type="FlutterPluginsLibraryType">
<CLASSES>
<root url="file://$PROJECT_DIR$" />
</CLASSES>
<CLASSES />
<JAVADOC />
<SOURCES />
</library>

@ -1,12 +0,0 @@
package io.openim.flutter_openim_sdk.listener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
public class OnMessageKvInfoListener implements open_im_sdk_callback.OnMessageKvInfoListener {
// 经过聚合后的kv,计算了总数,判断了是否包含自己
@Override
public void onMessageKvInfoChanged(String s) {
CommonUtil.emitEvent("messageKvInfoListener", "onMessageKvInfoChanged", s);
}
}

@ -5,7 +5,6 @@ import io.flutter.plugin.common.MethodChannel;
import io.openim.flutter_openim_sdk.listener.OnAdvancedMsgListener;
import io.openim.flutter_openim_sdk.listener.OnBaseListener;
import io.openim.flutter_openim_sdk.listener.OnCustomBusinessListener;
import io.openim.flutter_openim_sdk.listener.OnMessageKvInfoListener;
import io.openim.flutter_openim_sdk.listener.OnMsgSendListener;
import io.openim.flutter_openim_sdk.util.CommonUtil;
import open_im_sdk.Open_im_sdk;
@ -14,74 +13,6 @@ import open_im_sdk.Open_im_sdk;
public class MessageManager extends BaseManager {
private final static String KEY_ID = "id";
// private final static Map<String, OnAdvancedMsgListener> listeners = new HashMap<>();
/* private static boolean initializedListener = false;
private final static Map<String, AdvancedMsgListener> listeners = new ConcurrentHashMap<>();
protected void clearListeners() {
initializedListener = false;
listeners.clear();
}
private final static OnAdvancedMsgListener sdkMsgListener = new OnAdvancedMsgListener() {
@Override
public void onRecvC2CReadReceipt(String s) {
for (AdvancedMsgListener l : listeners.values()) {
l.onRecvC2CReadReceipt(s);
}
}
@Override
public void onRecvMessageRevoked(String s) {
for (AdvancedMsgListener l : listeners.values()) {
l.onRecvMessageRevoked(s);
}
}
@Override
public void onRecvNewMessage(String s) {
for (AdvancedMsgListener l : listeners.values()) {
l.onRecvNewMessage(s);
}
}
};
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
Open_im_sdk.addAdvancedMsgListener(new AdvancedMsgListener(key));
listeners.put(key, new AdvancedMsgListener(key));
if (!initializedListener) {
initializedListener = true;
Open_im_sdk.addAdvancedMsgListener(sdkMsgListener);
}
}
public void removeAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
listeners.remove(key);
if (listeners.isEmpty()) {
initializedListener = false;
Open_im_sdk.removeAdvancedMsgListener(sdkMsgListener);
}
}*/
/*
public void addAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
if (!listeners.containsKey(key)) {
AdvancedMsgListener listener = new AdvancedMsgListener(key);
listeners.put(methodCall.argument(KEY_ID), listener);
Open_im_sdk.addAdvancedMsgListener(listener);
}
}
public void removeAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
OnAdvancedMsgListener listener = listeners.remove(key);
Open_im_sdk.removeAdvancedMsgListener(listener);
}
*/
public void setAdvancedMsgListener(MethodCall methodCall, MethodChannel.Result result) {
String key = methodCall.argument(KEY_ID);
Open_im_sdk.setAdvancedMsgListener(new OnAdvancedMsgListener(key));
@ -437,54 +368,4 @@ public class MessageManager extends BaseManager {
result.success(null);
}
public void setMessageKvInfoListener(MethodCall methodCall, MethodChannel.Result result) {
Open_im_sdk.setMessageKvInfoListener(new OnMessageKvInfoListener());
result.success(null);
}
// public void setMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.setMessageReactionExtensions(
// new OnBaseListener(result, methodCall),
// value(methodCall, "operationID"),
// jsonValue(methodCall, "message"),
// jsonValue(methodCall, "list")
// );
// }
//
// public void deleteMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.deleteMessageReactionExtensions(
// new OnBaseListener(result, methodCall),
// value(methodCall, "operationID"),
// jsonValue(methodCall, "message"),
// jsonValue(methodCall, "list")
// );
// }
//
// public void getMessageListReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.getMessageListReactionExtensions(
// new OnBaseListener(result, methodCall),
// value(methodCall, "operationID"),
// jsonValue(methodCall, "messageList")
// );
// }
//
// public void addMessageReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.addMessageReactionExtensions(
// new OnBaseListener(result, methodCall),
// value(methodCall, "operationID"),
// jsonValue(methodCall, "message"),
// jsonValue(methodCall, "list")
// );
// }
//
// public void getMessageListSomeReactionExtensions(MethodCall methodCall, MethodChannel.Result result) {
// Open_im_sdk.getMessageListSomeReactionExtensions(
// new OnBaseListener(result, methodCall),
// value(methodCall, "operationID"),
// jsonValue(methodCall, "messageList"),
// jsonValue(methodCall, "list")
// );
// }
}

@ -3,8 +3,7 @@ import OpenIMCore
public class MessageManager: BaseServiceManager {
private let KEY_ID: String = "id"
// private var listeners: [String: AdvancedMsgListener] = [:]
public override func registerHandlers() {
super.registerHandlers()
self["setAdvancedMsgListener"] = setAdvancedMsgListener
@ -53,8 +52,6 @@ public class MessageManager: BaseServiceManager {
self["createVideoMessageByURL"] = createVideoMessageByURL
self["createFileMessageByURL"] = createFileMessageByURL
self["setCustomBusinessListener"] = setCustomBusinessListener
self["setMessageKvInfoListener"] = setMessageKvInfoListener
}
func setAdvancedMsgListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
@ -249,11 +246,6 @@ public class MessageManager: BaseServiceManager {
Open_im_sdkSetCustomBusinessListener(CustomBusinessListener(channel: channel))
callBack(result)
}
func setMessageKvInfoListener(methodCall: FlutterMethodCall, result: @escaping FlutterResult){
Open_im_sdkSetMessageKvInfoListener(MessageKvInfoListener(channel: channel))
callBack(result)
}
}
public class SendMsgProgressListener: NSObject, Open_im_sdk_callbackSendMsgCallBackProtocol {
@ -375,18 +367,3 @@ public class CustomBusinessListener: NSObject, Open_im_sdk_callbackOnCustomBusin
}
}
public class MessageKvInfoListener: NSObject, Open_im_sdk_callbackOnMessageKvInfoListenerProtocol {
private let channel: FlutterMethodChannel
init(channel: FlutterMethodChannel) {
self.channel = channel
}
public func onMessageKvInfoChanged(_ s: String?) {
CommonUtil.emitEvent(channel: channel, method: "messageKvInfoListener", type: "onMessageKvInfoChanged", errCode: nil, errMsg: nil, data: s)
}
}

@ -8,9 +8,6 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
let messageManager: MessageManager
let groupManager: GroupManager
let userManger: UserManager
// let signalingManager: SignalingManager
// let workMomentsManager: WorkMomentsManager
// let organizationManager: OrganizationManager
init(channel: FlutterMethodChannel) {
self.imManager = IMMananger(channel: channel)
@ -19,9 +16,6 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
self.messageManager = MessageManager(channel: channel)
self.groupManager = GroupManager(channel: channel)
self.userManger = UserManager(channel: channel)
// self.signalingManager = SignalingManager(channel: channel)
// self.workMomentsManager = WorkMomentsManager(channel: channel)
// self.organizationManager = OrganizationManager(channel: channel)
}
public static func register(with registrar: FlutterPluginRegistrar) {
@ -45,12 +39,6 @@ public class SwiftFlutterOpenimSdkPlugin: NSObject, FlutterPlugin {
groupManager.handleMethod(call: call, result: result)
case "userManager":
userManger.handleMethod(call: call, result: result)
// case "signalingManager":
// signalingManager.handleMethod(call: call, result: result)
// case "workMomentsManager":
// workMomentsManager.handleMethod(call: call, result: result)
// case "organizationManager":
// organizationManager.handleMethod(call: call, result: result)
default:
print("Handle ManagerName Error: \(managerName) not found")
}

@ -18,7 +18,6 @@ export 'src/listener/custom_business_listener.dart';
export 'src/listener/friendship_listener.dart';
export 'src/listener/group_listener.dart';
export 'src/listener/listener_for_service.dart';
export 'src/listener/message_kv_info_listener.dart';
export 'src/listener/msg_send_progress_listener.dart';
export 'src/listener/upload_file_listener.dart';
export 'src/listener/user_listener.dart';
@ -30,7 +29,6 @@ export 'src/manager/im_message_manager.dart';
export 'src/manager/im_user_manager.dart';
export 'src/models/conversation_info.dart';
export 'src/models/group_info.dart';
export 'src/models/meeting_info.dart';
export 'src/models/message.dart';
export 'src/models/notification_info.dart';
export 'src/models/search_info.dart';

@ -1,14 +1,15 @@
///
/// Conversation types
class ConversationType {
///
/// Single chat
static const single = 1;
///
/// Group (Deprecated in v3)
@Deprecated('Use superGroup instead')
static const group = 2;
///
/// Super group chat
static const superGroup = 3;
///
/// Notification
static const notification = 4;
}

@ -1,17 +1,17 @@
///
/// Conversation Strong Hint Content
class GroupAtType {
/// resetConversationGroupAtType方法
/// Cancel all hints, equivalent to calling the resetConversationGroupAtType method
static const atNormal = 0;
/// @
/// @ me hint
static const atMe = 1;
/// @
/// @ all hint
static const atAll = 2;
/// @@
/// @ all and @ me hint
static const atAllAtMe = 3;
///
/// Group notification hint
static const groupNotification = 4;
}

@ -1,11 +1,11 @@
///
/// Group Member Roles
class GroupRoleLevel {
///
/// Group owner
static const owner = 100;
///
/// Administrator
static const admin = 60;
///
/// Regular member
static const member = 20;
}

@ -1,8 +1,9 @@
///
/// Group Types
class GroupType {
///
/// General group (Deprecated in v3)
@Deprecated('Use work instead')
static const int general = 0;
///
/// Work group
static const int work = 2;
}

@ -1,11 +1,11 @@
///
/// Group Join Verification Settings
class GroupVerification {
///
/// Apply and invite directly for entry
static const int applyNeedVerificationInviteDirectly = 0;
///
/// Everyone needs verification to join, except for group owners and administrators who can invite directly
static const int allNeedVerification = 1;
///
/// Directly join the group
static const int directly = 2;
}

@ -1,15 +1,16 @@
/// flutter平台仅支持Android/ios
/// The current Flutter platform supports only Android/iOS
class IMPlatform {
/// IOS
/// iOS
static const ios = 1;
/// Android
static const android = 2;
static const windows = 3;
static const xos = 4;
static const web = 5;
static const mini_web = 6;
static const miniWeb = 6;
static const linux = 7;
static const android_pad = 8;
static const androidPad = 8;
static const ipad = 9;
}

@ -1,4 +1,4 @@
/// callback类型
/// Callback Types
class ListenerType {
static const simpleMsgListener = 'simpleMsgListener';
static const connectListener = 'connectListener';

@ -1,14 +1,14 @@
///
/// Message Send Status
class MessageStatus {
///
/// Sending
static const sending = 1;
///
/// Successfully sent
static const succeeded = 2;
///
/// Send failed
static const failed = 3;
///
/// Already deleted
static const deleted = 4;
}

@ -1,171 +1,179 @@
///
/// Message Types
class MessageType {
///
/// Normal text
static const text = 101;
///
/// Picture
static const picture = 102;
///
/// Voice
static const voice = 103;
///
/// Video
static const video = 104;
///
/// File
static const file = 105;
/// @
static const at_text = 106;
/// @ Message
static const atText = 106;
///
/// Merge
static const merger = 107;
///
/// Business Card
static const card = 108;
///
/// Location
static const location = 109;
///
/// Custom
static const custom = 110;
///
static const has_read_receipt = 112;
/// Has Read Receipt
static const hasReadReceipt = 112;
///
/// Typing
static const typing = 113;
///
/// Quote Reply
static const quote = 114;
///
static const custom_face = 115;
/// Custom Emoji
static const customFace = 115;
///
/// Group Message Has Read Receipt (Deprecated in v3)
@Deprecated('Use GroupHasReadReceiptNotification instead')
static const groupHasReadReceipt = 116;
///
/// Rich Text Message
static const advancedText = 117;
static const customMsgNotTriggerConversation = 119;
static const customMsgOnlineOnly = 120;
///
/// Notification Types
static const notificationBegin = 1000;
static const friendNotificationBegin = 1200;
///
/// Friend Request Accepted
static const friendApplicationApprovedNotification = 1201;
///
/// Friend Request Rejected
static const friendApplicationRejectedNotification = 1202;
///
/// Friend Request
static const friendApplicationNotification = 1203;
///
/// Friend Added
static const friendAddedNotification = 1204;
///
/// Friend Deleted
static const friendDeletedNotification = 1205;
///
/// Set Friend Remark
static const friendRemarkSetNotification = 1206;
///
/// Friend Added to Blacklist
static const blackAddedNotification = 1207;
///
/// Removed from Blacklist
static const blackDeletedNotification = 1208;
static const friendNotificationEnd = 1299;
///
/// Conversation Change
static const conversationChangeNotification = 1300;
static const userNotificationBegin = 1301;
///
/// User Information Changed
static const userInfoUpdatedNotification = 1303;
static const userNotificationEnd = 1399;
/// OA通知
/// OA Notification
static const oaNotification = 1400;
static const groupNotificationBegin = 1500;
///
/// Group Created
static const groupCreatedNotification = 1501;
///
/// Group Info Set
static const groupInfoSetNotification = 1502;
///
/// Join Group Application
static const joinGroupApplicationNotification = 1503;
/// 退
/// Group Member Quit
static const memberQuitNotification = 1504;
///
/// Group Application Accepted
static const groupApplicationAcceptedNotification = 1505;
///
/// Group Application Rejected
static const groupApplicationRejectedNotification = 1506;
///
/// Group Owner Transferred
static const groupOwnerTransferredNotification = 1507;
///
/// Member Kicked from Group
static const memberKickedNotification = 1508;
///
/// Member Invited to Group
static const memberInvitedNotification = 1509;
///
/// Member Entered Group
static const memberEnterNotification = 1510;
///
/// Dismiss Group
static const dismissGroupNotification = 1511;
static const groupNotificationEnd = 1599;
///
/// Group Member Muted
static const groupMemberMutedNotification = 1512;
///
/// Group Member Cancel Muted
static const groupMemberCancelMutedNotification = 1513;
///
/// Group Muted
static const groupMutedNotification = 1514;
///
/// Cancel Group Muted
static const groupCancelMutedNotification = 1515;
///
/// Group Member Information Changed
static const groupMemberInfoChangedNotification = 1516;
///
static const groupNoticeChangedNotification = 1519;
///
static const groupNameChangedNotification = 1520;
/// Group Member Set to Admin
static const groupMemberSetToAdminNotification = 1517;
static const signalingNotificationBegin = 1600;
static const groupMemberSetToOrdinaryUserNotification = 1518;
///
static const signalingNotification = 1601;
/// Group Notice Changed
static const groupNoticeChangedNotification = 1519;
static const signalingNotificationEnd = 1699;
/// Group Name Changed
static const groupNameChangedNotification = 1520;
///
/// Burn After Reading
static const burnAfterReadingNotification = 1701;
static const notificationEnd = 2000;
///
/// Business Notification
static const businessNotification = 2001;
/// Recall Message
static const revokeMessageNotification = 2101;
/// Single Chat Has Read Receipt
static const signalHasReadReceiptNotification = 2150;
/// Group Chat Has Read Receipt
static const groupHasReadReceiptNotification = 2155;
}

@ -1,172 +1,155 @@
// ///
// class MessageFailedCode {
// ///
// static const int blockedByFriend = 1302;
//
// ///
// static const int deletedByFriend = 1303;
//
// /// /
// static const int notInGroup = 1204;
// }
//
// ///
// class AddFriendFailedCode {
// ///
// static const int refuseToAddFriends = 10013;
// }
/// SDK Error Codes
class SDKErrorCode {
///
/// Network Request Error
static const int networkRequestError = 10000;
///
/// Network Waiting Timeout Error
static const int networkWaitTimeoutError = 10001;
///
/// Parameter Error
static const int parameterError = 10002;
/// 退
/// Context Timeout Error, usually when the user has already logged out
static const int contextTimeoutError = 10003;
///
/// Resources not loaded completely, usually uninitialized or login hasn't completed
static const int resourceNotLoaded = 10004;
/// errmsg
/// Unknown Error, check the error message for details
static const int unknownError = 10005;
/// sdk errmsg
/// SDK Internal Error, check the error message for details
static const int sdkInternalError = 10006;
///
/// This user has set not to be added
static const int refuseToAddFriends = 10013;
///
/// User does not exist or is not registered
static const int userNotExistOrNotRegistered = 10100;
/// 退
/// User has already logged out
static const int userHasLoggedOut = 10101;
/// getloginstatus
/// User is attempting to log in again, check the login status to avoid duplicate logins
static const int repeatLogin = 10102;
///
/// The file to upload does not exist
static const int uploadFileNotExist = 10200;
///
/// Message decompression failed
static const int messageDecompressionFailed = 10201;
///
/// Message decoding failed
static const int messageDecodingFailed = 10202;
///
/// Unsupported long connection binary protocol
static const int unsupportedLongConnection = 10203;
///
/// Message sent multiple times
static const int messageRepeated = 10204;
///
/// Message content type not supported
static const int messageContentTypeNotSupported = 10205;
///
/// Unsupported session operation
static const int unsupportedSessionOperation = 10301;
/// ID
/// Group ID does not exist
static const int groupIDNotExist = 10400;
///
/// Group type is incorrect
static const int wrongGroupType = 10401;
///
/// Server Internal Error, usually an internal network error, check if server nodes are running correctly
static const int serverInternalError = 500;
/// body header
/// Parameter Error on the server, check if body and header parameters are correct
static const int serverParameterError = 1001;
/// header token
/// Insufficient Permissions, typically when the token in the header is incorrect or when trying to perform unauthorized actions
static const int insufficientPermissions = 1002;
///
/// Duplicate Database Primary Key
static const int duplicateDatabasePrimaryKey = 1003;
///
/// Database Record Not Found
static const int databaseRecordNotFound = 1004;
/// ID
/// User ID does not exist
static const int userIDNotExist = 1101;
///
/// User is already registered
static const int userAlreadyRegistered = 1102;
///
/// Group does not exist
static const int groupNotExis = 1201;
///
/// Group already exists
static const int groupAlreadyExists = 1202;
///
/// User is not in the group
static const int userIsNotInGroup = 1203;
///
/// Group has been disbanded
static const int groupDisbanded = 1204;
///
/// Group application has already been processed, no need to process it again
static const int groupApplicationHasBeenProcessed = 1206;
///
/// Cannot add yourself as a friend
static const int notAddMyselfAsAFriend = 1301;
///
/// You have been blocked by the other party
static const int hasBeenBlocked = 1302;
///
/// The other party is not your friend
static const int notFriend = 1303;
///
/// Already in a friend relationship, no need to reapply
static const int alreadyAFriendRelationship = 1304;
///
/// Message read function is turned off
static const int messageReadFunctionIsTurnedOff = 1401;
///
/// You have been banned from speaking in the group
static const int youHaveBeenBanned = 1402;
///
/// The group has been banned from posting
static const int groupHasBeenBanned = 1403;
///
/// This message has been retracted
static const int messageHasBeenRetracted = 1404;
///
/// Authorization has expired
static const int licenseExpired = 1405;
/// token
/// Token has expired
static const int tokenHasExpired = 1501;
/// token
/// Invalid token
static const int tokenInvalid = 1502;
/// token
/// Token format error
static const int tokenFormatError = 1503;
/// token
/// Token has not yet taken effect
static const int tokenHasNotYetTakenEffect = 1504;
/// token
/// Unknown token error
static const int unknownTokenError = 1505;
/// token
/// The kicked-out token is invalid
static const int thekickedOutTokenIsInvalid = 1506;
/// token
/// Token does not exist
static const int tokenNotExist = 1507;
///
/// Number of Connections Exceeds Gateway's Maximum Limit
static const int connectionsExceedsMaximumLimit = 1601;
///
/// Handshake Parameter Error
static const int handshakeParameterError = 1602;
///
/// File Upload Expired
static const int fileUploadExpired = 1701;
}

@ -1,13 +1,11 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
///
/// Message Listener
class OnAdvancedMsgListener {
Function(Message msg)? onMsgDeleted;
Function(RevokedInfo info)? onNewRecvMessageRevoked;
Function(List<ReadReceiptInfo> list)? onRecvC2CReadReceipt;
Function(List<ReadReceiptInfo> list)? onRecvGroupReadReceipt;
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsAdded;
Function(String msgID, List<KeyValue> list)? onRecvMessageExtensionsChanged;
Function(String msgID, List<String> list)? onRecvMessageExtensionsDeleted;
Function(Message msg)? onRecvNewMessage;
Function(Message msg)? onRecvOfflineNewMessage;
@ -20,8 +18,6 @@ class OnAdvancedMsgListener {
this.onNewRecvMessageRevoked,
this.onRecvC2CReadReceipt,
this.onRecvGroupReadReceipt,
this.onRecvMessageExtensionsAdded,
this.onRecvMessageExtensionsChanged,
this.onRecvMessageExtensionsDeleted,
this.onRecvNewMessage,
this.onRecvOfflineNewMessage,
@ -31,38 +27,28 @@ class OnAdvancedMsgListener {
onMsgDeleted?.call(msg);
}
///
/// Message has been retracted
void newRecvMessageRevoked(RevokedInfo info) {
onNewRecvMessageRevoked?.call(info);
}
/// C2C消息已读回执
/// C2C Message Read Receipt
void recvC2CReadReceipt(List<ReadReceiptInfo> list) {
onRecvC2CReadReceipt?.call(list);
}
///
/// Group Message Read Receipt
void recvGroupReadReceipt(List<ReadReceiptInfo> list) {
onRecvGroupReadReceipt?.call(list);
}
/// kv新增
void recvMessageExtensionsAdded(String msgID, List<KeyValue> list) {
onRecvMessageExtensionsAdded?.call(msgID, list);
}
/// kv改变
void recvMessageExtensionsChanged(String msgID, List<KeyValue> list) {
onRecvMessageExtensionsChanged?.call(msgID, list);
}
///
/// [list] TypeKey
/// Received Extended Message Deleted
/// [list] TypeKey that was deleted
void recvMessageExtensionsDeleted(String msgID, List<String> list) {
onRecvMessageExtensionsDeleted?.call(msgID, list);
}
///
/// Received a new message
void recvNewMessage(Message msg) {
onRecvNewMessage?.call(msg);
}

@ -1,4 +1,4 @@
/// SDK
/// SDK Connection State Listener
class OnConnectListener {
Function(int? code, String? errorMsg)? onConnectFailed;
Function()? onConnectSuccess;
@ -14,27 +14,27 @@ class OnConnectListener {
this.onUserTokenExpired,
});
/// SDK连接服务器失败
/// SDK failed to connect to the server
void connectFailed(int? code, String? errorMsg) {
onConnectFailed?.call(code, errorMsg);
}
/// SDK连接服务器成功
/// SDK successfully connected to the server
void connectSuccess() {
onConnectSuccess?.call();
}
/// SDK正在连接服务器
/// SDK is currently connecting to the server
void connecting() {
onConnecting?.call();
}
/// 线
/// The account has been logged in from another location, and the current device has been kicked offline
void kickedOffline() {
onKickedOffline?.call();
}
///
/// Login credentials have expired and require reauthentication
void userTokenExpired() {
onUserTokenExpired?.call();
}

@ -1,6 +1,6 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
///
/// Conversation Listener
class OnConversationListener {
Function(List<ConversationInfo> list)? onConversationChanged;
Function(List<ConversationInfo> list)? onNewConversation;
@ -18,19 +18,19 @@ class OnConversationListener {
this.onSyncServerStart,
});
///
/// Conversations have changed
void conversationChanged(List<ConversationInfo> list) {
onConversationChanged?.call(list);
}
///
/// New conversations have been created
void newConversation(List<ConversationInfo> list) {
onNewConversation?.call(list);
}
///
void totalUnreadMessageCountChanged(int i) {
onTotalUnreadMessageCountChanged?.call(i);
/// Total unread message count has changed
void totalUnreadMessageCountChanged(int count) {
onTotalUnreadMessageCountChanged?.call(count);
}
void syncServerFailed() {

@ -1,16 +1,16 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
///
/// Friendship Listener
class OnFriendshipListener {
Function(BlacklistInfo i)? onBlackAdded;
Function(BlacklistInfo i)? onBlackDeleted;
Function(FriendInfo i)? onFriendAdded;
Function(FriendApplicationInfo i)? onFriendApplicationAccepted;
Function(FriendApplicationInfo i)? onFriendApplicationAdded;
Function(FriendApplicationInfo i)? onFriendApplicationDeleted;
Function(FriendApplicationInfo i)? onFriendApplicationRejected;
Function(FriendInfo i)? onFriendDeleted;
Function(FriendInfo i)? onFriendInfoChanged;
Function(BlacklistInfo info)? onBlackAdded;
Function(BlacklistInfo info)? onBlackDeleted;
Function(FriendInfo info)? onFriendAdded;
Function(FriendApplicationInfo info)? onFriendApplicationAccepted;
Function(FriendApplicationInfo info)? onFriendApplicationAdded;
Function(FriendApplicationInfo info)? onFriendApplicationDeleted;
Function(FriendApplicationInfo info)? onFriendApplicationRejected;
Function(FriendInfo info)? onFriendDeleted;
Function(FriendInfo info)? onFriendInfoChanged;
OnFriendshipListener({
this.onBlackAdded,
@ -24,48 +24,48 @@ class OnFriendshipListener {
this.onFriendInfoChanged,
});
///
void blackAdded(BlacklistInfo u) {
onBlackAdded?.call(u);
/// Added to the blacklist
void blackAdded(BlacklistInfo info) {
onBlackAdded?.call(info);
}
///
void blackDeleted(BlacklistInfo u) {
onBlackDeleted?.call(u);
/// Removed from the blacklist
void blackDeleted(BlacklistInfo info) {
onBlackDeleted?.call(info);
}
///
void friendAdded(FriendInfo u) {
onFriendAdded?.call(u);
/// Friend added
void friendAdded(FriendInfo info) {
onFriendAdded?.call(info);
}
///
void friendApplicationAccepted(FriendApplicationInfo u) {
onFriendApplicationAccepted?.call(u);
/// Friend application accepted
void friendApplicationAccepted(FriendApplicationInfo info) {
onFriendApplicationAccepted?.call(info);
}
///
void friendApplicationAdded(FriendApplicationInfo u) {
onFriendApplicationAdded?.call(u);
/// New friend application added
void friendApplicationAdded(FriendApplicationInfo info) {
onFriendApplicationAdded?.call(info);
}
///
void friendApplicationDeleted(FriendApplicationInfo u) {
onFriendApplicationDeleted?.call(u);
/// Friend application deleted
void friendApplicationDeleted(FriendApplicationInfo info) {
onFriendApplicationDeleted?.call(info);
}
///
void friendApplicationRejected(FriendApplicationInfo u) {
onFriendApplicationRejected?.call(u);
/// Friend application rejected
void friendApplicationRejected(FriendApplicationInfo info) {
onFriendApplicationRejected?.call(info);
}
///
void friendDeleted(FriendInfo u) {
onFriendDeleted?.call(u);
/// Friend deleted
void friendDeleted(FriendInfo info) {
onFriendDeleted?.call(info);
}
///
void friendInfoChanged(FriendInfo u) {
onFriendInfoChanged?.call(u);
/// Friend information changed
void friendInfoChanged(FriendInfo info) {
onFriendInfoChanged?.call(info);
}
}

@ -1,6 +1,6 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
///
/// Group Listener
class OnGroupListener {
Function(GroupApplicationInfo info)? onGroupApplicationAccepted;
Function(GroupApplicationInfo info)? onGroupApplicationAdded;
@ -28,22 +28,22 @@ class OnGroupListener {
this.onJoinedGroupDeleted,
});
///
/// Group application accepted
void groupApplicationAccepted(GroupApplicationInfo info) {
onGroupApplicationAccepted?.call(info);
}
///
/// Group application added
void groupApplicationAdded(GroupApplicationInfo info) {
onGroupApplicationAdded?.call(info);
}
///
/// Group application deleted
void groupApplicationDeleted(GroupApplicationInfo info) {
onGroupApplicationDeleted?.call(info);
}
///
/// Group application rejected
void groupApplicationRejected(GroupApplicationInfo info) {
onGroupApplicationRejected?.call(info);
}
@ -52,32 +52,32 @@ class OnGroupListener {
onGroupDismissed?.call(info);
}
///
/// Group information changed
void groupInfoChanged(GroupInfo info) {
onGroupInfoChanged?.call(info);
}
///
/// Group member added
void groupMemberAdded(GroupMembersInfo info) {
onGroupMemberAdded?.call(info);
}
///
/// Group member deleted
void groupMemberDeleted(GroupMembersInfo info) {
onGroupMemberDeleted?.call(info);
}
///
/// Group member information changed
void groupMemberInfoChanged(GroupMembersInfo info) {
onGroupMemberInfoChanged?.call(info);
}
///
/// Joined group added
void joinedGroupAdded(GroupInfo info) {
onJoinedGroupAdded?.call(info);
}
///
/// Joined group deleted
void joinedGroupDeleted(GroupInfo info) {
onJoinedGroupDeleted?.call(info);
}

@ -1,6 +1,6 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
///
/// Friend Relationship Listener
class OnListenerForService {
Function(FriendApplicationInfo i)? onFriendApplicationAdded;
Function(FriendApplicationInfo i)? onFriendApplicationAccepted;

@ -1,11 +0,0 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class OnMessageKvInfoListener {
Function(List<MessageKv> list)? onMessageKvInfoChanged;
OnMessageKvInfoListener({this.onMessageKvInfoChanged});
void messageKvInfoChanged(List<MessageKv> list) {
onMessageKvInfoChanged?.call(list);
}
}

@ -1,10 +1,10 @@
///
/// Message Sending Progress Listener
class OnMsgSendProgressListener {
Function(String clientMsgID, int progress)? onProgress;
OnMsgSendProgressListener({this.onProgress});
///
/// Message sending progress
void progress(String clientMsgID, int progress) {
onProgress?.call(clientMsgID, progress);
}

@ -1,6 +1,6 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
///
/// Current User Profile Listener
class OnUserListener {
/// The information of the logged-in user has been updated
Function(UserInfo info)? onSelfInfoUpdated;
@ -8,11 +8,12 @@ class OnUserListener {
OnUserListener({this.onSelfInfoUpdated, this.onUserStatusChanged});
///
/// Callback for changes in user's own information
void selfInfoUpdated(UserInfo info) {
onSelfInfoUpdated?.call(info);
}
/// Callback for changes in user status
void userStatusChanged(UserStatusInfo info) {
onUserStatusChanged?.call(info);
}

@ -9,13 +9,13 @@ class ConversationManager {
ConversationManager(this._channel);
///
/// Conversation Listener
Future setConversationListener(OnConversationListener listener) {
this.listener = listener;
return _channel.invokeMethod('setConversationListener', _buildParam({}));
}
///
/// Get All Conversations
Future<List<ConversationInfo>> getAllConversationList(
{String? operationID}) =>
_channel
@ -27,9 +27,9 @@ class ConversationManager {
.then((value) =>
Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
///
/// [offset]
/// [count]
/// Paginate Through Conversations
/// [offset] Starting index
/// [count] Number of items per page
Future<List<ConversationInfo>> getConversationListSplit({
int offset = 0,
int count = 20,
@ -46,9 +46,9 @@ class ConversationManager {
.then((value) =>
Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
///
/// [sourceID] userIDGroupID
/// [sessionType] [ConversationType]
/// Query a Conversation; if it doesn't exist, it will be created
/// [sourceID] UserID for one-on-one conversation, GroupID for group conversation
/// [sessionType] Reference [ConversationType]
Future<ConversationInfo> getOneConversation({
required String sourceID,
required int sessionType,
@ -65,8 +65,8 @@ class ConversationManager {
.then((value) =>
Utils.toObj(value, (map) => ConversationInfo.fromJson(map)));
/// id获取多个会话
/// [conversationIDList] id列表
/// Get Multiple Conversations by Conversation ID
/// [conversationIDList] List of conversation IDs
Future<List<ConversationInfo>> getMultipleConversation({
required List<String> conversationIDList,
String? operationID,
@ -81,9 +81,9 @@ class ConversationManager {
.then((value) =>
Utils.toList(value, (map) => ConversationInfo.fromJson(map)));
/// 稿
/// [conversationID] id
/// [draftText] 稿
/// Set Conversation Draft
/// [conversationID] Conversation ID
/// [draftText] Draft text
Future setConversationDraft({
required String conversationID,
required String draftText,
@ -97,9 +97,9 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [conversationID] id
/// [isPinned] truefalse
/// Pin a Conversation
/// [conversationID] Conversation ID
/// [isPinned] true: pin, false: unpin
Future pinConversation({
required String conversationID,
required bool isPinned,
@ -113,8 +113,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [conversationID] id
/// Hide a Conversation
/// [conversationID] Conversation ID
Future hideConversation({
required String conversationID,
String? operationID,
@ -126,34 +126,31 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// int.tryParse(count) ?? 0;
Future<dynamic> getTotalUnreadMsgCount({
String? operationID,
}) =>
/// Get Total Unread Message Count
Future<dynamic> getTotalUnreadMsgCount({String? operationID}) =>
_channel.invokeMethod(
'getTotalUnreadMsgCount',
_buildParam({
"operationID": Utils.checkOperationID(operationID),
}));
/// id
/// [sourceID] IDID
/// [sessionType] [ConversationType]
// Future<dynamic> getConversationIDBySessionType({
// required String sourceID,
// required int sessionType,
// }) =>
// _channel.invokeMethod(
// 'getConversationIDBySessionType',
// _buildParam({
// "sourceID": sourceID,
// "sessionType": sessionType,
// }));
/// Query Conversation ID
/// [sourceID] UserID for one-on-one, GroupID for group
/// [sessionType] Reference [ConversationType]
Future<dynamic> getConversationIDBySessionType({
required String sourceID,
required int sessionType,
}) =>
_channel.invokeMethod(
'getConversationIDBySessionType',
_buildParam({
"sourceID": sourceID,
"sessionType": sessionType,
}));
///
/// [conversationID] id
/// [status] 012线线
/// Message Do-Not-Disturb Setting
/// [conversationID] Conversation ID
/// [status] 0: normal; 1: not receiving messages; 2: receive online messages but not offline messages
Future<dynamic> setConversationRecvMessageOpt({
required String conversationID,
required int status,
@ -167,9 +164,9 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [conversationIDList] id列表
/// [{"conversationId":"single_13922222222","result":0}]result值012线线
/// Query Do-Not-Disturb Status
/// [conversationIDList] List of conversation IDs
/// Returns: [{"conversationId":"single_13922222222","result":0}], result values: 0: normal; 1: not receiving messages; 2: receive online messages but not offline messages
Future<List<dynamic>> getConversationRecvMessageOpt({
required List<String> conversationIDList,
String? operationID,
@ -183,9 +180,9 @@ class ConversationManager {
}))
.then((value) => Utils.toListMap(value));
///
/// [conversationID] id
/// [isPrivate] truefalse
/// Self-Destruct Messages
/// [conversationID] Conversation ID
/// [isPrivate] true: enable, false: disable
Future<dynamic> setConversationPrivateChat({
required String conversationID,
required bool isPrivate,
@ -199,8 +196,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [conversationID] ID
/// Delete a Conversation Locally and from the Server
/// [conversationID] Conversation ID
Future<dynamic> deleteConversationAndDeleteAllMsg({
required String conversationID,
String? operationID,
@ -212,8 +209,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [conversationID] ID
/// Clear Messages in a Conversation
/// [conversationID] Conversation ID
Future<dynamic> clearConversationAndDeleteAllMsg({
required String conversationID,
String? operationID,
@ -225,7 +222,7 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// Delete All Local Conversations
Future<dynamic> deleteAllConversationFromLocal({
String? operationID,
}) =>
@ -235,8 +232,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// [GroupAtType]
/// [conversationID] id
/// Reset Mentioned (Group At) Flags [GroupAtType]
/// [conversationID] Conversation ID
Future<dynamic> resetConversationGroupAtType({
required String conversationID,
String? operationID,
@ -248,7 +245,7 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// @
/// Query @ All Flag
Future<dynamic> getAtAllTag({
String? operationID,
}) =>
@ -258,11 +255,11 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// @
/// Get @ All Tag
String get atAllTag => 'AtAllTag';
///
/// [status] 012线线
/// Global Do-Not-Disturb
/// [status] 0: normal; 1: not receiving messages; 2: receive online messages but not offline messages
Future<dynamic> setGlobalRecvMessageOpt({
required int status,
String? operationID,
@ -274,9 +271,9 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [conversationID] id
/// [burnDuration] s30s
/// Set Self-Destruct Message Duration
/// [conversationID] Conversation ID
/// [burnDuration] Duration in seconds, default: 30s
Future<dynamic> setConversationBurnDuration({
required String conversationID,
int burnDuration = 30,
@ -290,9 +287,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [conversationID] ID
/// [messageIDList] clientMsgID
/// Mark Messages as Read
/// [conversationID] Conversation ID
Future markConversationMessageAsRead({
required String conversationID,
String? operationID,
@ -304,8 +300,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [isMsgDestruct] true
/// Enable Regular Deletion
/// [isMsgDestruct] true: enable
Future<dynamic> setConversationIsMsgDestruct({
required String conversationID,
bool isMsgDestruct = true,
@ -319,8 +315,8 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [duration]
/// Regularly Delete Chat Records
/// [duration] Seconds
Future<dynamic> setConversationMsgDestructTime({
required String conversationID,
int duration = 1 * 24 * 60 * 60,
@ -334,7 +330,7 @@ class ConversationManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// Custom Sort for Conversation List
List<ConversationInfo> simpleSort(List<ConversationInfo> list) => list
..sort((a, b) {
if ((a.isPinned == true && b.isPinned == true) ||

@ -7,14 +7,14 @@ class FriendshipManager {
FriendshipManager(this._channel);
///
/// Friend Relationship Listener
Future setFriendshipListener(OnFriendshipListener listener) {
this.listener = listener;
return _channel.invokeMethod('setFriendListener', _buildParam({}));
}
///
/// [userIDList] userID集合
/// Query Friend Information
/// [userIDList] List of user IDs
Future<List<UserInfo>> getFriendsInfo({
required List<String> userIDList,
String? operationID,
@ -28,9 +28,9 @@ class FriendshipManager {
}))
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
///
/// [userID] ID
/// [reason]
/// Send a Friend Request, the other party needs to accept the request to become friends.
/// [userID] User ID to be invited
/// [reason] Remark description
Future<dynamic> addFriend({
required String userID,
String? reason,
@ -44,7 +44,7 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// Get Friend Requests Sent to Me
Future<List<FriendApplicationInfo>> getFriendApplicationListAsRecipient(
{String? operationID}) =>
_channel
@ -56,7 +56,7 @@ class FriendshipManager {
.then((value) =>
Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
///
/// Get Friend Requests Sent by Me
Future<List<FriendApplicationInfo>> getFriendApplicationListAsApplicant(
{String? operationID}) =>
_channel
@ -68,7 +68,7 @@ class FriendshipManager {
.then((value) =>
Utils.toList(value, (v) => FriendApplicationInfo.fromJson(v)));
///
/// Get Friend List, including friends who have been put into the blacklist
Future<List<UserInfo>> getFriendList({String? operationID}) => _channel
.invokeMethod(
'getFriendList',
@ -77,7 +77,7 @@ class FriendshipManager {
}))
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
///
/// Get Friend List, including friends who have been put into the blacklist (returns a map)
Future<List<dynamic>> getFriendListMap({String? operationID}) => _channel
.invokeMethod(
'getFriendList',
@ -86,9 +86,9 @@ class FriendshipManager {
}))
.then((value) => Utils.toListMap(value));
///
/// [userID] userID
/// [remark]
/// Set Friend's Remark
/// [userID] Friend's userID
/// [remark] Friend's remark
Future<dynamic> setFriendRemark({
required String userID,
required String remark,
@ -102,8 +102,8 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [userID] ID
/// Add to Blacklist
/// [userID] Friend's ID to be added to the blacklist
Future<dynamic> addBlacklist({
required String userID,
String? operationID,
@ -115,7 +115,7 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// Get Blacklist
Future<List<UserInfo>> getBlacklist({String? operationID}) => _channel
.invokeMethod(
'getBlacklist',
@ -124,8 +124,8 @@ class FriendshipManager {
}))
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
///
/// [userID] ID
/// Remove from Blacklist
/// [userID] User ID
Future<dynamic> removeBlacklist({
required String userID,
String? operationID,
@ -137,8 +137,8 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [userIDList] userID列表
/// Check Friendship Status
/// [userIDList] List of user IDs
Future<List<FriendshipInfo>> checkFriend({
required List<String> userIDList,
String? operationID,
@ -153,8 +153,8 @@ class FriendshipManager {
.then((value) =>
Utils.toList(value, (v) => FriendshipInfo.fromJson(v)));
///
/// [userID] ID
/// Delete Friend
/// [userID] User ID
Future<dynamic> deleteFriend({
required String userID,
String? operationID,
@ -166,9 +166,9 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [userID] ID
/// [handleMsg]
/// Accept Friend Request
/// [userID] User ID
/// [handleMsg] Remark description
Future<dynamic> acceptFriendApplication({
required String userID,
String? handleMsg,
@ -182,9 +182,9 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [userID] ID
/// [handleMsg]
/// Reject Friend Request
/// [userID] User ID
/// [handleMsg] Remark description
Future<dynamic> refuseFriendApplication({
required String userID,
String? handleMsg,
@ -198,11 +198,11 @@ class FriendshipManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [keywordList]
/// [isSearchUserID] ID(false)false
/// [isSearchNickname] false
/// [isSearchRemark] false
/// Search for Friends
/// [keywordList] Search keywords, currently supports only one keyword search, cannot be empty
/// [isSearchUserID] Whether to search for friend IDs with keywords (note: cannot be false at the same time), defaults to false if empty
/// [isSearchNickname] Whether to search by nickname with keywords, defaults to false if empty
/// [isSearchRemark] Whether to search by remark name with keywords, defaults to false if empty
Future<List<FriendInfo>> searchFriends({
List<String> keywordList = const [],
bool isSearchUserID = false,

@ -9,15 +9,15 @@ class GroupManager {
GroupManager(this._channel);
///
/// Group relationship listener
Future setGroupListener(OnGroupListener listener) {
this.listener = listener;
return _channel.invokeMethod('setGroupListener', _buildParam({}));
}
///
/// [groupID] ID
/// [userIDList] ID列表
/// Invite users to a group, allowing them to join without approval.
/// [groupID] Group ID
/// [userIDList] List of user IDs
Future<List<GroupInviteResult>> inviteUserToGroup({
required String groupID,
required List<String> userIDList,
@ -33,13 +33,12 @@ class GroupManager {
'reason': reason,
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
.then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
///
/// [groupID] ID
/// [userIDList] ID列表
/// [reason]
/// Remove group members
/// [groupID] Group ID
/// [userIDList] List of user IDs
/// [reason] Reason for removal
Future<List<GroupInviteResult>> kickGroupMember({
required String groupID,
required List<String> userIDList,
@ -55,12 +54,11 @@ class GroupManager {
'reason': reason,
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
.then((value) => Utils.toList(value, (map) => GroupInviteResult.fromJson(map)));
///
/// [groupID] ID
/// [userIDList] ID列表
/// Query group member information
/// [groupID] Group ID
/// [userIDList] List of user IDs
Future<List<GroupMembersInfo>> getGroupMembersInfo({
required String groupID,
required List<String> userIDList,
@ -74,14 +72,13 @@ class GroupManager {
'userIDList': userIDList,
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
///
/// [groupID] ID
/// [filter] 01 , 234+ 5,+
/// [offset]
/// [count]
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// Paginate and retrieve the group member list
/// [groupID] Group ID
/// [filter] Member filter (0: All, 1: Group owner, 2: Administrator, 3: Regular member, 4: Admin + Regular member, 5: Group owner + Admin)
/// [offset] Starting index
/// [count] Total count
Future<List<GroupMembersInfo>> getGroupMemberList({
required String groupID,
int filter = 0,
@ -99,14 +96,13 @@ class GroupManager {
'count': count,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
///
/// [groupID] ID
/// [filter] 01 , 234+ 5,+
/// [offset]
/// [count]
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// Paginate and retrieve the group member list as a map
/// [groupID] Group ID
/// [filter] Member filter (0: All, 1: Group owner, 2: Administrator, 3: Regular member, 4: Admin + Regular member, 5: Group owner + Admin)
/// [offset] Starting index
/// [count] Total count
Future<List<dynamic>> getGroupMemberListMap({
required String groupID,
int filter = 0,
@ -126,7 +122,7 @@ class GroupManager {
}))
.then((value) => Utils.toListMap(value));
///
/// Query the list of joined groups
Future<List<GroupInfo>> getJoinedGroupList({String? operationID}) => _channel
.invokeMethod(
'getJoinedGroupList',
@ -135,7 +131,7 @@ class GroupManager {
}))
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
///
/// Query the list of joined groups
Future<List<dynamic>> getJoinedGroupListMap({String? operationID}) => _channel
.invokeMethod(
'getJoinedGroupList',
@ -144,8 +140,8 @@ class GroupManager {
}))
.then((value) => Utils.toListMap(value));
///
/// [groupID] ID
/// Check if the user has joined a group
/// [groupID] Group ID
Future<bool> isJoinedGroup({
required String groupID,
String? operationID,
@ -159,14 +155,11 @@ class GroupManager {
}))
.then((value) => value == 'true' ? true : false);
///
/// [groupName]
/// [notification]
/// [introduction]
/// [faceUrl]
/// [groupType] [GroupType]
/// [ex]
/// [list] [GroupMemberRole]
/// Create a new group
/// [groupInfo] Group information
/// [memberUserIDs] List of user IDs to add as initial members
/// [adminUserIDs] List of user IDs to add as administrators
/// [ownerUserID] User ID of the owner
Future<GroupInfo> createGroup({
required GroupInfo groupInfo,
List<String> memberUserIDs = const [],
@ -184,16 +177,9 @@ class GroupManager {
'ownerUserID': ownerUserID,
'operationID': Utils.checkOperationID(operationID),
}))
.then(
(value) => Utils.toObj(value, (map) => GroupInfo.fromJson(map)));
///
/// [groupID] ID
/// [groupName]
/// [notification]
/// [introduction]
/// [faceURL]
/// [ex]
.then((value) => Utils.toObj(value, (map) => GroupInfo.fromJson(map)));
/// Edit group information
Future<dynamic> setGroupInfo({
required String groupID,
String? groupName,
@ -223,8 +209,7 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
///
/// [groupIDList] ID列表
/// Query group information
Future<List<GroupInfo>> getGroupsInfo({
required List<String> groupIDList,
String? operationID,
@ -236,11 +221,10 @@ class GroupManager {
'groupIDList': groupIDList,
'operationID': Utils.checkOperationID(operationID),
}))
.then(
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
/// /
/// [joinSource] 2 3 4
/// Apply to join a group, requiring approval from an administrator or the group.
/// [joinSource] 2: Invited, 3: Searched, 4: Using a QR code
Future<dynamic> joinGroup({
required String groupID,
String? reason,
@ -256,7 +240,7 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
/// 退
/// Exit a group
Future<dynamic> quitGroup({
required String groupID,
String? operationID,
@ -268,9 +252,9 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
///
/// [groupID] ID
/// [userID] ID
// (Continuing the code)
/// Transfer group ownership
Future<dynamic> transferGroupOwner({
required String groupID,
required String userID,
@ -284,34 +268,26 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
///
Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient(
{String? operationID}) =>
_channel
.invokeMethod(
'getGroupApplicationListAsRecipient',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
/// Handle group membership applications received as a group owner or administrator
Future<List<GroupApplicationInfo>> getGroupApplicationListAsRecipient({String? operationID}) => _channel
.invokeMethod(
'getGroupApplicationListAsRecipient',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
///
Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant(
{String? operationID}) =>
_channel
.invokeMethod(
'getGroupApplicationListAsApplicant',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
/// Get the list of group membership applications sent by the user
Future<List<GroupApplicationInfo>> getGroupApplicationListAsApplicant({String? operationID}) => _channel
.invokeMethod(
'getGroupApplicationListAsApplicant',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => GroupApplicationInfo.fromJson(map)));
///
/// //
/// [groupID] id
/// [userID] ID
/// Accept a group membership application as an administrator or group owner
/// Note: Membership applications require approval from administrators or the group.
Future<dynamic> acceptGroupApplication({
required String groupID,
required String userID,
@ -327,11 +303,8 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
///
/// //
/// [groupID] id
/// [userID] ID
/// [handleMsg]
/// Refuse a group membership application as an administrator or group owner
/// Note: Membership applications require approval from administrators or the group.
Future<dynamic> refuseGroupApplication({
required String groupID,
required String userID,
@ -347,8 +320,10 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
///
/// [groupID] ID
// (Continuing the code)
/// Dissolve a group
/// [groupID] Group ID
Future<dynamic> dismissGroup({
required String groupID,
String? operationID,
@ -360,9 +335,9 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
///
/// [groupID] ID
/// [mute] truefalse
/// Enable or disable group mute, preventing all group members from sending messages
/// [groupID] Group ID
/// [mute] true: Enable, false: Disable
Future<dynamic> changeGroupMute({
required String groupID,
required bool mute,
@ -376,10 +351,10 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
///
/// [groupID] ID
/// [userID] ID
/// [seconds] s0
/// Mute a group member
/// [groupID] Group ID
/// [userID] Member ID to mute
/// [seconds] Duration of the mute in seconds (set to 0 to unmute)
Future<dynamic> changeGroupMemberMute({
required String groupID,
required String userID,
@ -395,10 +370,10 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
///
/// [groupID] ID
/// [userID] ID
/// [groupNickname]
/// Set the nickname of a group member
/// [groupID] Group ID
/// [userID] User ID of the group member
/// [groupNickname] Group nickname
Future<dynamic> setGroupMemberNickname({
required String groupID,
required String userID,
@ -414,10 +389,10 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
///
/// [keywordList]
/// [isSearchGroupID] ID(false)false
/// [isSearchGroupName] false
/// Query a group
/// [keywordList] Search keywords; currently, only one keyword is supported, and it cannot be empty.
/// [isSearchGroupID] Whether to search by group ID (Note: cannot set both to false at the same time); defaults to false if not set.
/// [isSearchGroupName] Whether to search by group name; defaults to false if not set.
Future<List<GroupInfo>> searchGroups({
List<String> keywordList = const [],
bool isSearchGroupID = false,
@ -435,13 +410,12 @@ class GroupManager {
},
'operationID': Utils.checkOperationID(operationID),
}))
.then(
(value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
.then((value) => Utils.toList(value, (map) => GroupInfo.fromJson(map)));
///
/// [groupID] ID
/// [userID] ID
/// [roleLevel] [GroupRoleLevel]
/// Set group member role
/// [groupID] Group ID
/// [userID] User ID of the group member
/// [roleLevel] Role level; see [GroupRoleLevel]
Future<dynamic> setGroupMemberRoleLevel({
required String groupID,
required String userID,
@ -457,13 +431,7 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
///
/// [groupID] ID
/// [joinTimeBegin]
/// [joinTimeEnd]
/// [offset]
/// [count]
/// [excludeUserIDList]
/// Get a group member list based on join time
Future<List<GroupMembersInfo>> getGroupMemberListByJoinTime({
required String groupID,
int offset = 0,
@ -485,12 +453,11 @@ class GroupManager {
'excludeUserIDList': excludeUserIDList,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
///
/// [groupID] ID
/// [needVerification] [GroupVerification]
/// Set group verification for joining
/// [groupID] Group ID
/// [needVerification] Verification setting; see [GroupVerification] class
Future<dynamic> setGroupVerification({
required String groupID,
required int needVerification,
@ -504,9 +471,9 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
///
/// [groupID] ID
/// [status] 01
/// Allow/disallow members to view each other's information through the group
/// [groupID] Group ID
/// [status] 0: Disable, 1: Enable
Future<dynamic> setGroupLookMemberInfo({
required String groupID,
required int status,
@ -520,9 +487,9 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
///
/// [groupID] ID
/// [status] 01
/// Allow/disallow members to add friends through the group
/// [groupID] Group ID
/// [status] 0: Disable, 1: Enable
Future<dynamic> setGroupApplyMemberFriend({
required String groupID,
required int status,
@ -536,8 +503,8 @@ class GroupManager {
'operationID': Utils.checkOperationID(operationID),
}));
///
/// [groupId] ID
/// Get group owners and administrators
/// [groupId] Group ID
Future<List<GroupMembersInfo>> getGroupOwnerAndAdmin({
required String groupID,
String? operationID,
@ -549,16 +516,15 @@ class GroupManager {
'groupID': groupID,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
///
/// [groupID] id
/// [keywordList]
/// [isSearchUserID] id
/// [isSearchMemberNickname]
/// [offset] index
/// [count]
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// Search for group members
/// [groupID] Group ID
/// [keywordList] Search keywords; currently, only one keyword is supported, and it cannot be empty.
/// [isSearchUserID] Whether to search by member ID
/// [isSearchMemberNickname] Whether to search by member nickname
/// [offset] Start index
/// [count] Total count to retrieve
Future<List<GroupMembersInfo>> searchGroupMembers({
required String groupID,
List<String> keywordList = const [],
@ -582,16 +548,15 @@ class GroupManager {
},
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) =>
Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
///
/// [groupID] id
/// [keywordList]
/// [isSearchUserID] id
/// [isSearchMemberNickname]
/// [offset] index
/// [count]
.then((value) => Utils.toList(value, (map) => GroupMembersInfo.fromJson(map)));
/// Query a group
/// [groupID] Group ID
/// [keywordList] Search keyword, currently only supports searching with one keyword, and it cannot be empty
/// [isSearchUserID] Whether to search member IDs with the keyword
/// [isSearchMemberNickname] Whether to search member nicknames with the keyword
/// [offset] Starting index
/// [count] Total number to retrieve each time
Future<List<dynamic>> searchGroupMembersListMap({
required String groupID,
List<String> keywordList = const [],
@ -617,7 +582,7 @@ class GroupManager {
}))
.then((value) => Utils.toListMap(value));
/// GroupMemberInfo ex字段
/// Modify the GroupMemberInfo ex field
Future<dynamic> setGroupMemberInfo({
required String groupID,
required String userID,
@ -634,7 +599,6 @@ class GroupManager {
},
'operationID': Utils.checkOperationID(operationID),
}));
static Map _buildParam(Map param) {
param["ManagerName"] = "groupManager";
log('param: $param');

@ -64,8 +64,9 @@ class IMManager {
userManager.listener.selfInfoUpdated(userInfo);
break;
case 'onUserStatusChanged':
final status = Utils.toObj(data, (map) => UserStatusInfo.fromJson(map));
userManager.listener.userStatusChanged(status);
final status =
Utils.toObj(data, (map) => UserStatusInfo.fromJson(map));
userManager.listener.userStatusChanged(status);
break;
}
} else if (call.method == ListenerType.groupListener) {
@ -73,19 +74,23 @@ class IMManager {
dynamic data = call.arguments['data'];
switch (type) {
case 'onGroupApplicationAccepted':
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
groupManager.listener.groupApplicationAccepted(i);
break;
case 'onGroupApplicationAdded':
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
groupManager.listener.groupApplicationAdded(i);
break;
case 'onGroupApplicationDeleted':
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
groupManager.listener.groupApplicationDeleted(i);
break;
case 'onGroupApplicationRejected':
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
groupManager.listener.groupApplicationRejected(i);
break;
case 'onGroupDismissed':
@ -97,15 +102,18 @@ class IMManager {
groupManager.listener.groupInfoChanged(i);
break;
case 'onGroupMemberAdded':
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
final i =
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
groupManager.listener.groupMemberAdded(i);
break;
case 'onGroupMemberDeleted':
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
final i =
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
groupManager.listener.groupMemberDeleted(i);
break;
case 'onGroupMemberInfoChanged':
final i = Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
final i =
Utils.toObj(data, (map) => GroupMembersInfo.fromJson(map));
groupManager.listener.groupMemberInfoChanged(i);
break;
case 'onJoinedGroupAdded':
@ -133,31 +141,22 @@ class IMManager {
break;
case 'onRecvC2CReadReceipt':
var value = call.arguments['data']['msgReceiptList'];
var list = Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
var list =
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
messageManager.msgListener.recvC2CReadReceipt(list);
break;
case 'onRecvGroupReadReceipt':
var value = call.arguments['data']['groupMsgReceiptList'];
var list = Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
var list =
Utils.toList(value, (map) => ReadReceiptInfo.fromJson(map));
messageManager.msgListener.recvGroupReadReceipt(list);
break;
case 'onRecvMessageExtensionsAdded':
var msgID = call.arguments['data']['msgID'];
var value = call.arguments['data']['reactionExtensionList'];
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
messageManager.msgListener.recvMessageExtensionsAdded(msgID, list);
break;
case 'onRecvMessageExtensionsChanged':
var msgID = call.arguments['data']['msgID'];
var value = call.arguments['data']['reactionExtensionList'];
var list = Utils.toList(value, (map) => KeyValue.fromJson(map));
messageManager.msgListener.recvMessageExtensionsChanged(msgID, list);
break;
case 'onRecvMessageExtensionsDeleted':
var msgID = call.arguments['data']['msgID'];
var value = call.arguments['data']['reactionExtensionKeyList'];
var list = Utils.toList(value, (map) => '$map');
messageManager.msgListener.recvMessageExtensionsDeleted(msgID, list);
messageManager.msgListener
.recvMessageExtensionsDeleted(msgID, list);
break;
case 'onRecvNewMessage':
@ -199,15 +198,18 @@ class IMManager {
conversationManager.listener.syncServerFailed();
break;
case 'onNewConversation':
var list = Utils.toList(data, (map) => ConversationInfo.fromJson(map));
var list =
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
conversationManager.listener.newConversation(list);
break;
case 'onConversationChanged':
var list = Utils.toList(data, (map) => ConversationInfo.fromJson(map));
var list =
Utils.toList(data, (map) => ConversationInfo.fromJson(map));
conversationManager.listener.conversationChanged(list);
break;
case 'onTotalUnreadMessageCountChanged':
conversationManager.listener.totalUnreadMessageCountChanged(data ?? 0);
conversationManager.listener
.totalUnreadMessageCountChanged(data ?? 0);
break;
}
} else if (call.method == ListenerType.friendListener) {
@ -228,19 +230,23 @@ class IMManager {
friendshipManager.listener.friendAdded(u);
break;
case 'onFriendApplicationAccepted':
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
friendshipManager.listener.friendApplicationAccepted(u);
break;
case 'onFriendApplicationAdded':
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
friendshipManager.listener.friendApplicationAdded(u);
break;
case 'onFriendApplicationDeleted':
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
friendshipManager.listener.friendApplicationDeleted(u);
break;
case 'onFriendApplicationRejected':
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
friendshipManager.listener.friendApplicationRejected(u);
break;
case 'onFriendDeleted':
@ -257,16 +263,8 @@ class IMManager {
String data = call.arguments['data'];
switch (type) {
case 'onRecvCustomBusinessMessage':
messageManager.customBusinessListener?.recvCustomBusinessMessage(data);
break;
}
} else if (call.method == ListenerType.messageKvInfoListener) {
String type = call.arguments['type'];
String data = call.arguments['data'];
switch (type) {
case 'onMessageKvInfoChanged':
final list = Utils.toList(data, (map) => MessageKv.fromJson(map)).toList();
messageManager.messageKvInfoListener?.messageKvInfoChanged(list);
messageManager.customBusinessListener
?.recvCustomBusinessMessage(data);
break;
}
} else if (call.method == ListenerType.listenerForService) {
@ -274,19 +272,23 @@ class IMManager {
String data = call.arguments['data'];
switch (type) {
case 'onFriendApplicationAccepted':
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
_listenerForService?.friendApplicationAccepted(u);
break;
case 'onFriendApplicationAdded':
final u = Utils.toObj(data, (map) => FriendApplicationInfo.fromJson(map));
final u = Utils.toObj(
data, (map) => FriendApplicationInfo.fromJson(map));
_listenerForService?.friendApplicationAdded(u);
break;
case 'onGroupApplicationAccepted':
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
_listenerForService?.groupApplicationAccepted(i);
break;
case 'onGroupApplicationAdded':
final i = Utils.toObj(data, (map) => GroupApplicationInfo.fromJson(map));
final i = Utils.toObj(
data, (map) => GroupApplicationInfo.fromJson(map));
_listenerForService?.groupApplicationAdded(i);
break;
case 'onRecvNewMessage':
@ -334,7 +336,8 @@ class IMManager {
int fileSize = data['fileSize'];
int streamSize = data['streamSize'];
int storageSize = data['storageSize'];
_uploadFileListener?.uploadProgress(id, fileSize, streamSize, storageSize);
_uploadFileListener?.uploadProgress(
id, fileSize, streamSize, storageSize);
break;
case 'uploadID':
String id = data['id'];
@ -346,26 +349,28 @@ class IMManager {
int index = data['index'];
int partSize = data['partSize'];
String partHash = data['partHash'];
_uploadFileListener?.uploadPartComplete(id, index, partSize, partHash);
_uploadFileListener?.uploadPartComplete(
id, index, partSize, partHash);
break;
}
}
} catch (error, stackTrace) {
Logger.print("回调失败了。${call.method} ${call.arguments['type']} ${call.arguments['data']} $error $stackTrace");
Logger.print(
"回调失败了。${call.method} ${call.arguments['type']} ${call.arguments['data']} $error $stackTrace");
}
return Future.value(null);
});
}
/// SDK
/// [platform] [IMPlatform]
/// [apiAddr] SDK api地址
/// [wsAddr] SDK websocket地址
/// [dataDir] SDK数据库存储目录
/// [objectStorage] cos/minio
/// [logLevel] 1
/// [enabledEncryption] true
/// [enabledCompression] true
/// Initialize the SDK
/// [platform] Platform ID [IMPlatform]
/// [apiAddr] SDK API address
/// [wsAddr] SDK WebSocket address
/// [dataDir] SDK database storage directory
/// [objectStorage] Object storage minio
/// [logLevel] Log level, 1: no printing
/// [enabledEncryption] true: encryption
/// [enabledCompression] true: compression
Future<dynamic> initSDK({
required int platformID,
required String apiAddr,
@ -373,46 +378,41 @@ class IMManager {
required String dataDir,
required OnConnectListener listener,
int logLevel = 6,
String objectStorage = 'cos',
// String? encryptionKey,
// bool isNeedEncryption = false,
// bool isCompression = false,
// bool isExternalExtensions = false,
String objectStorage = 'minio',
bool isCompression = false,
bool isLogStandardOutput = true,
String? logFilePath,
String? operationID,
}) {
this._connectListener = listener;
return _channel.invokeMethod(
'initSDK',
_buildParam(
{
"platformID": platformID,
"apiAddr": apiAddr,
"wsAddr": wsAddr,
"dataDir": dataDir,
"logLevel": logLevel,
"objectStorage": objectStorage,
// "encryptionKey": encryptionKey,
// "isNeedEncryption": isNeedEncryption,
// "isCompression": isCompression,
// "isExternalExtensions": isExternalExtensions,
"isLogStandardOutput": isLogStandardOutput,
"logFilePath": logFilePath,
"operationID": Utils.checkOperationID(operationID),
},
));
'initSDK',
_buildParam(
{
"platformID": platformID,
"apiAddr": apiAddr,
"wsAddr": wsAddr,
"dataDir": dataDir,
"logLevel": logLevel,
"objectStorage": objectStorage,
"isCompression": isCompression,
"isLogStandardOutput": isLogStandardOutput,
"logFilePath": logFilePath,
"operationID": Utils.checkOperationID(operationID),
},
),
);
}
/// SDK
/// Deinitialize the SDK
Future<dynamic> unInitSDK() {
return _channel.invokeMethod('unInitSDK', _buildParam({}));
}
///
/// [userID] id
/// [token] token
/// [defaultValue] 使
/// Login
/// [userID] User ID
/// [token] Login token obtained from the business server
/// [defaultValue] Default value to use if login fails
Future<UserInfo> login({
required String userID,
required String token,
@ -422,7 +422,7 @@ class IMManager {
}) async {
int? status;
if (checkLoginStatus) {
// 1: logout 2: logging 3:logged
// 1: logout 2: logging 3: logged
status = await getLoginStatus();
}
if (status != LoginStatus.logging && status != LoginStatus.logged) {
@ -450,36 +450,38 @@ class IMManager {
// return uInfo;
}
///
/// Logout
Future<dynamic> logout({String? operationID}) async {
var value = await _channel.invokeMethod(
'logout',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}));
'logout',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}),
);
this.isLogined = false;
this.token = null;
return value;
}
///
/// 1: logout 2: logging 3:logged
/// Get login status
/// 1: logout 2: logging 3: logged
Future<int?> getLoginStatus({
String? operationID,
}) =>
_channel.invokeMethod<int>(
'getLoginStatus',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}));
'getLoginStatus',
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}),
);
/// id
/// Get the current logged-in user ID
Future<String> getLoginUserID() async => userID;
///
/// Get the current logged-in user information
Future<UserInfo> getLoginUserInfo() async => userInfo;
///[id] [OnUploadFileListener] id一致
/// [id] Same as [OnUploadFileListener] ID, to distinguish which file callback it is
Future uploadFile({
required String id,
required String filePath,
@ -489,50 +491,30 @@ class IMManager {
String? operationID,
}) =>
_channel.invokeMethod(
'uploadFile',
_buildParam({
'id': id,
'filePath': filePath,
'name': fileName,
'contentType': contentType,
'cause': cause,
'operationID': Utils.checkOperationID(operationID),
}));
'uploadFile',
_buildParam({
'id': id,
'filePath': filePath,
'name': fileName,
'contentType': contentType,
'cause': cause,
'operationID': Utils.checkOperationID(operationID),
}),
);
/// firebase客户端注册token
/// [fcmToken] firebase token
/// Update the Firebase client registration token
/// [fcmToken] Firebase token
Future updateFcmToken({
required String fcmToken,
String? operationID,
}) =>
_channel.invokeMethod(
'updateFcmToken',
_buildParam({
'fcmToken': fcmToken,
'operationID': Utils.checkOperationID(operationID),
}));
/// app处于后台
// Future setAppBackgroundStatus({
// required bool isBackground,
// String? operationID,
// }) =>
// _channel.invokeMethod(
// 'setAppBackgroundStatus',
// _buildParam({
// 'isBackground': isBackground,
// 'operationID': Utils.checkOperationID(operationID),
// }));
///
// Future networkStatusChanged({
// String? operationID,
// }) =>
// _channel.invokeMethod(
// 'networkStatusChanged',
// _buildParam({
// 'operationID': Utils.checkOperationID(operationID),
// }));
'updateFcmToken',
_buildParam({
'fcmToken': fcmToken,
'operationID': Utils.checkOperationID(operationID),
}),
);
void setUploadFileListener(OnUploadFileListener listener) {
_uploadFileListener = listener;

@ -4,15 +4,13 @@ import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class MessageManager {
MethodChannel _channel;
// List<AdvancedMsgListener> advancedMsgListeners = List.empty(growable: true);
OnMsgSendProgressListener? msgSendProgressListener;
late OnAdvancedMsgListener msgListener;
OnCustomBusinessListener? customBusinessListener;
OnMessageKvInfoListener? messageKvInfoListener;
MessageManager(this._channel);
///
/// Message listener
Future setAdvancedMsgListener(OnAdvancedMsgListener listener) {
this.msgListener = listener;
// advancedMsgListeners.add(listener);
@ -23,16 +21,16 @@ class MessageManager {
}));
}
///
/// Message send progress listener
void setMsgSendProgressListener(OnMsgSendProgressListener listener) {
msgSendProgressListener = listener;
}
///
/// [message]
/// [userID] id
/// [groupID] id
/// [offlinePushInfo] 线
/// Send a message
/// [message] Message content
/// [userID] User ID of the recipient
/// [groupID] Group ID of the recipient
/// [offlinePushInfo] Offline message display content
Future<Message> sendMessage({
required Message message,
required OfflinePushInfo offlinePushInfo,
@ -52,8 +50,8 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [message]
/// Delete a message from local storage
/// [message] Message to be deleted
Future deleteMessageFromLocalStorage({
required String conversationID,
required String clientMsgID,
@ -68,8 +66,8 @@ class MessageManager {
}));
/// core-sdk: DeleteMessage
///
/// [message]
/// Delete a specified message from local and server
/// [message] Message to be deleted
Future<dynamic> deleteMessageFromLocalAndSvr({
required String conversationID,
required String clientMsgID,
@ -83,7 +81,7 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// Delete all local chat records
Future<dynamic> deleteAllMsgFromLocal({
String? operationID,
}) =>
@ -93,7 +91,7 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// Delete all chat records from local and server
Future<dynamic> deleteAllMsgFromLocalAndSvr({
String? operationID,
}) =>
@ -103,10 +101,10 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [receiverID] id
/// [senderID] id
/// [message]
/// Insert a single chat message into local storage
/// [receiverID] Receiver's ID
/// [senderID] Sender's ID
/// [message] Message content
Future<Message> insertSingleMessageToLocalStorage({
String? receiverID,
String? senderID,
@ -124,10 +122,10 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [groupID] id
/// [senderID] id
/// [message]
/// Insert a group chat message into local storage
/// [groupID] Group ID
/// [senderID] Sender's ID
/// [message] Message content
Future<Message> insertGroupMessageToLocalStorage({
String? groupID,
String? senderID,
@ -145,8 +143,8 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [msgTip]
/// Typing status update
/// [msgTip] Custom content
Future typingStatusUpdate({
required String userID,
String? msgTip,
@ -160,7 +158,7 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// Create a text message
Future<Message> createTextMessage({
required String text,
String? operationID,
@ -174,11 +172,11 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
/// @
/// [text]
/// [atUserIDList] @userID集合
/// [atUserInfoList] userID跟nickname映射关系id替换为nickname
/// [quoteMessage]
/// Create an @ message
/// [text] Input content
/// [atUserIDList] Collection of userIDs being mentioned
/// [atUserInfoList] Mapping of userID to nickname, used for displaying nicknames instead of IDs in the user interface
/// [quoteMessage] Quoted message (the message being replied to)
Future<Message> createTextAtMessage({
required String text,
required List<String> atUserIDList,
@ -199,8 +197,8 @@ class MessageManager {
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [imagePath]
/// Create an image message
/// [imagePath] Path
Future<Message> createImageMessage({
required String imagePath,
String? operationID,
@ -215,8 +213,8 @@ class MessageManager {
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [imagePath]
/// Create an image message from a full path
/// [imagePath] Path
Future<Message> createImageMessageFromFullPath({
required String imagePath,
String? operationID,
@ -231,9 +229,9 @@ class MessageManager {
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [soundPath]
/// [duration] s
/// Create a sound message
/// [soundPath] Path
/// [duration] Duration in seconds
Future<Message> createSoundMessage({
required String soundPath,
required int duration,
@ -250,9 +248,9 @@ class MessageManager {
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [soundPath]
/// [duration] s
/// Create a sound message from a full path
/// [soundPath] Path
/// [duration] Duration in seconds
Future<Message> createSoundMessageFromFullPath({
required String soundPath,
required int duration,
@ -269,11 +267,11 @@ class MessageManager {
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [videoPath]
/// [videoType] mime类型
/// [duration] s
/// [snapshotPath]
/// Create a video message
/// [videoPath] Path
/// [videoType] Video MIME type
/// [duration] Duration in seconds
/// [snapshotPath] Default snapshot image path
Future<Message> createVideoMessage({
required String videoPath,
required String videoType,
@ -293,11 +291,11 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [videoPath]
/// [videoType] mime类型
/// [duration] s
/// [snapshotPath]
/// Create a video message from a full path
/// [videoPath] Path
/// [videoType] Video MIME type
/// [duration] Duration in seconds
/// [snapshotPath] Default snapshot image path
Future<Message> createVideoMessageFromFullPath({
required String videoPath,
required String videoType,
@ -317,9 +315,9 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [filePath]
/// [fileName]
/// Create a file message
/// [filePath] Path
/// [fileName] File name
Future<Message> createFileMessage({
required String filePath,
required String fileName,
@ -336,9 +334,9 @@ class MessageManager {
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
}
///
/// [filePath]
/// [fileName]
/// Create a file message from a full path
/// [filePath] Path
/// [fileName] File name
Future<Message> createFileMessageFromFullPath({
required String filePath,
required String fileName,
@ -354,10 +352,10 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [messageList]
/// [title]
/// [summaryList]
/// Create a merged message
/// [messageList] Selected messages
/// [title] Summary title
/// [summaryList] Summary content
Future<Message> createMergerMessage({
required List<Message> messageList,
required String title,
@ -375,8 +373,8 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [message]
/// Create a forwarded message
/// [message] Message to be forwarded
Future<Message> createForwardMessage({
required Message message,
String? operationID,
@ -391,10 +389,10 @@ class MessageManager {
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
}
///
/// [latitude]
/// [longitude]
/// [description]
/// Create a location message
/// [latitude] Latitude
/// [longitude] Longitude
/// [description] Custom description
Future<Message> createLocationMessage({
required double latitude,
required double longitude,
@ -412,10 +410,10 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [data]
/// [extension]
/// [description]
/// Create a custom message
/// [data] Custom data
/// [extension] Custom extension content
/// [description] Custom description content
Future<Message> createCustomMessage({
required String data,
required String extension,
@ -433,9 +431,9 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [text]
/// [quoteMsg]
/// Create a quoted message
/// [text] Reply content
/// [quoteMsg] Message being replied to
Future<Message> createQuoteMessage({
required String text,
required Message quoteMsg,
@ -451,8 +449,8 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [data]
/// Create a card message
/// [data] Custom data
Future<Message> createCardMessage({
required String userID,
required String nickname,
@ -474,9 +472,9 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [index] index匹配
/// [data] url表情使url显示
/// Create a custom emoji message
/// [index] Positional emoji, matched based on index
/// [data] URL emoji, displayed directly using the URL
Future<Message> createFaceMessage({
int index = -1,
String? data,
@ -492,16 +490,16 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [conversationID] null
/// [keywordList]
/// [keywordListMatchType] 12
/// [senderUserIDList] uid列表
/// [messageTypeList]
/// [searchTimePosition] 0UTC
/// [searchTimePeriod] 024x60x60代表过去一天
/// [pageIndex]
/// [count]
/// Search messages
/// [conversationID] Query based on conversation, pass null for global search
/// [keywordList] Search keyword list, currently supports searching with a single keyword
/// [keywordListMatchType] Keyword matching mode, 1 means AND, 2 means OR (currently unused)
/// [senderUserIDList] List of UIDs for messages sent (currently unused)
/// [messageTypeList] Message type list
/// [searchTimePosition] Start time point for searching. Defaults to 0, meaning searching from now. UTC timestamp, in seconds
/// [searchTimePeriod] Time range in the past from the start time point, in seconds. Defaults to 0, meaning no time range limitation. Pass 24x60x60 to represent the past day
/// [pageIndex] Current page number
/// [count] Number of messages per page
Future<SearchResult> searchLocalMessages({
String? conversationID,
List<String> keywordList = const [],
@ -531,10 +529,11 @@ class MessageManager {
},
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => SearchResult.fromJson(map)));
.then((value) =>
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
///
/// [message]
/// Revoke a message
/// [message] The message to be revoked
Future revokeMessage({
required String conversationID,
required String clientMsgID,
@ -548,9 +547,9 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID),
}));
///
/// [conversationID] ID
/// [messageIDList] clientMsgID
/// Mark messages as read
/// [conversationID] Conversation ID
/// [messageIDList] List of clientMsgIDs of messages to be marked as read
Future markMessagesAsReadByMsgID({
required String conversationID,
required List<String> messageIDList,
@ -564,11 +563,11 @@ class MessageManager {
"operationID": Utils.checkOperationID(operationID),
}));
/// (startMsg为节点)
/// [conversationID] id
/// [startMsg] [count]index==length-1startMsg=list.first
/// [count]
/// [lastMinSeq] [startMsg]
/// Get chat history (messages prior to startMsg)
/// [conversationID] Conversation ID, can be used for querying notifications
/// [startMsg] Query [count] messages starting from this message. The message at index == length - 1 is the latest message, so to get the next page of history, use startMsg = list.first
/// [count] Total number of messages to retrieve in one request
/// [lastMinSeq] Not required for the first page of messages, but necessary for getting the second page of history. Same as [startMsg]
Future<AdvancedMessage> getAdvancedHistoryMessageList({
String? conversationID,
Message? startMsg,
@ -586,12 +585,13 @@ class MessageManager {
'lastMinSeq': lastMinSeq ?? 0,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
.then((value) =>
Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
/// (startMsg为节点)
/// [conversationID] id
/// [startMsg] [count]index==length-1startMsg=list.last
/// [count]
/// Get chat history (newly received chat history after startMsg). Used for locating a specific message in global search and then fetching messages received after that message.
/// [conversationID] Conversation ID, can be used for querying notifications
/// [startMsg] Query [count] messages starting from this message. The message at index == length - 1 is the latest message, so to get the next page of history, use startMsg = list.last
/// [count] Total number of messages to retrieve in one request
Future<AdvancedMessage> getAdvancedHistoryMessageListReverse({
String? conversationID,
Message? startMsg,
@ -609,11 +609,12 @@ class MessageManager {
'lastMinSeq': lastMinSeq ?? 0,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
.then((value) =>
Utils.toObj(value, (map) => AdvancedMessage.fromJson(map)));
///
/// [conversationID] id
/// [clientMsgIDList] id列表
/// Find message details
/// [conversationID] Conversation ID
/// [clientMsgIDList] List of message IDs
Future<SearchResult> findMessageList({
required List<SearchParams> searchParams,
String? operationID,
@ -625,11 +626,12 @@ class MessageManager {
'searchParams': searchParams.map((e) => e.toJson()).toList(),
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toObj(value, (map) => SearchResult.fromJson(map)));
.then((value) =>
Utils.toObj(value, (map) => SearchResult.fromJson(map)));
///
/// [text]
/// [list]
/// Rich text message
/// [text] Input content
/// [list] Details of the rich text message
Future<Message> createAdvancedTextMessage({
required String text,
List<RichMessageInfo> list = const [],
@ -646,10 +648,10 @@ class MessageManager {
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [text]
/// [quoteMsg]
/// [list]
/// Rich text message with quote
/// [text] Content for the reply
/// [quoteMsg] The message being replied to
/// [list] Details of the rich text message
Future<Message> createAdvancedQuoteMessage({
required String text,
required Message quoteMsg,
@ -667,11 +669,11 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// [message] [createImageMessageByURL],[createSoundMessageByURL],[createVideoMessageByURL],[createFileMessageByURL]
/// [userID] id
/// [groupID] id
/// [offlinePushInfo] 线
/// Send a message
/// [message] Message body [createImageMessageByURL],[createSoundMessageByURL],[createVideoMessageByURL],[createFileMessageByURL]
/// [userID] User ID to receive the message
/// [groupID] Group ID to receive the message
/// [offlinePushInfo] Offline message display content
Future<Message> sendMessageNotOss({
required Message message,
required OfflinePushInfo offlinePushInfo,
@ -691,7 +693,7 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// Create an image message by URL
Future<Message> createImageMessageByURL({
required PictureInfo sourcePicture,
required PictureInfo bigPicture,
@ -710,7 +712,7 @@ class MessageManager {
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// Create a sound message
Future<Message> createSoundMessageByURL({
required SoundElem soundElem,
String? operationID,
@ -725,7 +727,7 @@ class MessageManager {
)
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// Create a video message
Future<Message> createVideoMessageByURL({
required VideoElem videoElem,
String? operationID,
@ -739,7 +741,7 @@ class MessageManager {
}))
.then((value) => Utils.toObj(value, (map) => Message.fromJson(map)));
///
/// Create a file message
Future<Message> createFileMessageByURL({
required FileElem fileElem,
String? operationID,
@ -775,85 +777,6 @@ class MessageManager {
}));
}
///
Future setMessageKvInfoListener(OnMessageKvInfoListener listener) {
this.messageKvInfoListener = listener;
return _channel.invokeMethod('setMessageKvInfoListener', _buildParam({}));
}
Future<List<TypeKeySetResult>> setMessageReactionExtensions({
required Message message,
List<KeyValue> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'setMessageReactionExtensions',
_buildParam({
'message': message.toJson(),
'list': list.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
Future<List<TypeKeySetResult>> deleteMessageReactionExtensions({
required Message message,
List<String> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'deleteMessageReactionExtensions',
_buildParam({
'message': message.toJson(),
'list': list,
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
Future<List<MessageTypeKeyMapping>> getMessageListReactionExtensions({
List<Message> messageList = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'getMessageListReactionExtensions',
_buildParam({
'messageList': messageList.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => MessageTypeKeyMapping.fromJson(map)));
Future<List<TypeKeySetResult>> addMessageReactionExtensions({
required Message message,
List<KeyValue> list = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'addMessageReactionExtensions',
_buildParam({
'message': message.toJson(),
'list': list.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => TypeKeySetResult.fromJson(map)));
Future<List<MessageTypeKeyMapping>> getMessageListSomeReactionExtensions({
List<Message> messageList = const [],
List<KeyValue> kvList = const [],
String? operationID,
}) =>
_channel
.invokeMethod(
'getMessageListSomeReactionExtensions',
_buildParam({
'messageList': messageList.map((e) => e.toJson()).toList(),
'list': kvList.map((e) => e.toJson()).toList(),
"operationID": Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => MessageTypeKeyMapping.fromJson(map)));
static Map _buildParam(Map param) {
param["ManagerName"] = "messageManager";
return param;

@ -7,14 +7,14 @@ class UserManager {
UserManager(this._channel);
///
/// User profile change listener
Future setUserListener(OnUserListener listener) {
this.listener = listener;
return _channel.invokeMethod('setUserListener', _buildParam({}));
}
///
/// [userIDList] ID列表
/// Get user information
/// [userIDList] List of user IDs
Future<List<UserInfo>> getUsersInfo({
required List<String> userIDList,
String? operationID,
@ -28,7 +28,7 @@ class UserManager {
}))
.then((value) => Utils.toList(value, (v) => UserInfo.fromJson(v)));
///
/// Get information of the currently logged-in user
Future<UserInfo> getSelfUserInfo({
String? operationID,
}) =>
@ -40,20 +40,20 @@ class UserManager {
}))
.then((value) => Utils.toObj(value, (map) => UserInfo.fromJson(map)));
///
/// [nickname]
/// [faceURL]
/// [gender]
/// [appMangerLevel]
/// [phoneNumber]
/// [birth]
/// [email]
/// [ex]
/// Modify the profile of the currently logged-in user
/// [nickname] Nickname
/// [faceURL] Profile picture
/// [gender] Gender
/// [appManagerLevel]
/// [phoneNumber] Phone number
/// [birth] Date of birth
/// [email] Email
/// [ex] Additional fields
Future<String?> setSelfInfo({
String? nickname,
String? faceURL,
int? gender,
int? appMangerLevel,
int? appManagerLevel,
String? phoneNumber,
int? birth,
String? email,
@ -67,7 +67,7 @@ class UserManager {
'nickname': nickname,
'faceURL': faceURL,
'gender': gender,
'appMangerLevel': appMangerLevel,
'appManagerLevel': appManagerLevel,
'phoneNumber': phoneNumber,
'birth': birth,
'email': email,
@ -86,7 +86,8 @@ class UserManager {
'userIDs': userIDs,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
.then((value) =>
Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
}
Future<List<UserStatusInfo>> unsubscribeUsersStatus(
@ -100,7 +101,8 @@ class UserManager {
'userIDs': userIDs,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
.then((value) =>
Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
}
Future<List<UserStatusInfo>> getSubscribeUsersStatus({
@ -112,7 +114,8 @@ class UserManager {
_buildParam({
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
.then((value) =>
Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
}
Future<List<UserStatusInfo>> getUserStatus(
@ -126,7 +129,8 @@ class UserManager {
'userIDs': userIDs,
'operationID': Utils.checkOperationID(operationID),
}))
.then((value) => Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
.then((value) =>
Utils.toList(value, (map) => UserStatusInfo.fromJson(map)));
}
Future<List<UserInfo>> getUsersInfoStranger(

@ -3,66 +3,67 @@ import 'dart:convert';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class ConversationInfo {
/// ID
// Unique identifier for the conversation
String conversationID;
/// [ConversationType]
// Type of the conversation (e.g., single, group, super group)
int? conversationType;
/// userID
// User ID in case of a single chat
String? userID;
/// groupID
// Group ID in case of a group chat
String? groupID;
///
// Display name or nickname
String? showName;
///
// URL of the user's or group's profile picture
String? faceURL;
/// 012线线
// Message reception option (0: normal, 1: do not accept messages, 2: accept online messages but not offline messages)
int? recvMsgOpt;
///
// Number of unread messages in the conversation
int? unreadCount;
/// [GroupAtType]@@
int? groupAtType;
///
// Latest message in the conversation
Message? latestMsg;
///
// Timestamp of the latest message
int? latestMsgSendTime;
/// 稿
// Draft text for the conversation
String? draftText;
/// 稿
// Timestamp when the draft text was created
int? draftTextTime;
///
// Indicates whether the conversation is pinned
bool? isPinned;
///
// Indicates whether the conversation is a private chat with features like self-destructing messages
bool? isPrivateChat;
/// s
// Duration for which messages are readable (in seconds)
int? burnDuration;
///
// Indicates whether the conversation has self-destructing messages enabled
bool? isMsgDestruct;
/// s
// Timestamp for self-destructing messages (in seconds)
int? msgDestructTime;
///
// Additional data or metadata
String? ex;
/// 退true
// Indicates whether the user is no longer in the group (if applicable)
bool? isNotInGroup;
// Group @ type, which includes @ all, @ individual, and announcement prompts
int? groupAtType;
// Constructor to create a ConversationInfo object
ConversationInfo({
required this.conversationID,
this.conversationType,
@ -115,6 +116,7 @@ class ConversationInfo {
msgDestructTime = json['msgDestructTime'];
}
// Method to convert the ConversationInfo object to a JSON map
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['conversationID'] = this.conversationID;
@ -140,16 +142,16 @@ class ConversationInfo {
return data;
}
///
// Check if it's a single chat
bool get isSingleChat => conversationType == ConversationType.single;
///
// Check if it's a group chat
bool get isGroupChat =>
conversationType == ConversationType.group ||
conversationType == ConversationType.superGroup;
///
bool get isValid => isSingleChat || isGroupChat && !isNotInGroup!;
// Check if it's a valid conversation (not in a group if isNotInGroup is true)
bool get isValid => isSingleChat || (isGroupChat && !isNotInGroup!);
@override
bool operator ==(Object other) =>

@ -1,56 +1,56 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
///
/// Group Information
class GroupInfo {
/// ID
/// Group ID
String groupID;
///
/// Group Name
String? groupName;
///
/// Group Announcement
String? notification;
///
/// Group Introduction
String? introduction;
///
/// Group Avatar
String? faceURL;
/// ID
/// Owner's ID
String? ownerUserID;
///
/// Creation Time
int? createTime;
///
/// Number of Group Members
int? memberCount;
/// 0123
/// Group Status: 0 - Normal, 1 - Blocked, 2 - Dissolved, 3 - Muted
int? status;
/// ID
/// Creator's ID
String? creatorUserID;
/// [GroupType]
/// Group Type [GroupType]
int? groupType;
///
/// Extra Information
String? ex;
/// [GroupVerification]
/// Entry Verification Method [GroupVerification]
int? needVerification;
/// 01
/// Don't Allow Access to Member Information via the Group: 0 - Disabled, 1 - Enabled
int? lookMemberInfo;
/// 01
/// Don't Allow Adding Friends via the Group: 0 - Disabled, 1 - Enabled
int? applyMemberFriend;
///
/// Notification Update Time
int? notificationUpdateTime;
///
/// Notification Initiator
String? notificationUserID;
GroupInfo({
@ -74,7 +74,6 @@ class GroupInfo {
});
GroupInfo.fromJson(Map<String, dynamic> json) : groupID = json['groupID'] {
/*groupID = json['groupID'];*/
groupName = json['groupName'];
notification = json['notification'];
introduction = json['introduction'];
@ -115,7 +114,7 @@ class GroupInfo {
return data;
}
///
/// Corresponding Conversation Type for Group Type
int get sessionType => groupType == GroupType.general
? ConversationType.group
: ConversationType.superGroup;
@ -131,42 +130,42 @@ class GroupInfo {
int get hashCode => groupID.hashCode;
}
///
/// Group Member Information
class GroupMembersInfo {
/// id
/// Group ID
String? groupID;
/// id
/// User ID
String? userID;
///
/// Nickname
String? nickname;
///
/// Avatar
String? faceURL;
/// [GroupRoleLevel]
/// Role [GroupRoleLevel]
int? roleLevel;
///
/// Join Time
int? joinTime;
/// 2 3 4
/// Entry Source: 2 - Invited, 3 - Searched, 4 - QR Code
int? joinSource;
/// id
/// Operator's ID
String? operatorUserID;
///
/// Extra Information
String? ex;
/// s
/// Mute End Time (seconds)
int? muteEndTime;
///
int? appMangerLevel;
/// Application Manager Level
int? appManagerLevel;
/// id
/// Inviter's User ID
String? inviterUserID;
GroupMembersInfo({
@ -180,7 +179,7 @@ class GroupMembersInfo {
this.joinSource,
this.operatorUserID,
this.muteEndTime,
this.appMangerLevel,
this.appManagerLevel,
this.inviterUserID,
});
@ -195,7 +194,7 @@ class GroupMembersInfo {
joinSource = json['joinSource'];
operatorUserID = json['operatorUserID'];
muteEndTime = json['muteEndTime'];
appMangerLevel = json['appMangerLevel'];
appManagerLevel = json['appManagerLevel'];
inviterUserID = json['inviterUserID'];
}
@ -211,7 +210,7 @@ class GroupMembersInfo {
data['joinSource'] = this.joinSource;
data['operatorUserID'] = this.operatorUserID;
data['muteEndTime'] = this.muteEndTime;
data['appMangerLevel'] = this.appMangerLevel;
data['appManagerLevel'] = this.appManagerLevel;
data['inviterUserID'] = this.inviterUserID;
return data;
}
@ -228,12 +227,12 @@ class GroupMembersInfo {
int get hashCode => groupID.hashCode ^ userID.hashCode;
}
///
/// Group Member Role
class GroupMemberRole {
/// ID
/// User ID
String? userID;
/// [GroupRoleLevel] 1, 23
/// [GroupRoleLevel] 1: Normal Member, 2: Group Owner, 3: Administrator
int? roleLevel;
GroupMemberRole({this.userID, this.roleLevel = 1});
@ -251,78 +250,78 @@ class GroupMemberRole {
}
}
///
/// Group Application Information
class GroupApplicationInfo {
/// ID
/// Group ID
String? groupID;
///
/// Group Nickname
String? groupName;
///
/// Group Announcement
String? notification;
///
/// Group Introduction
String? introduction;
///
/// Group Avatar
String? groupFaceURL;
///
/// Group Creation Time
int? createTime;
///
/// Group Status
int? status;
/// id
/// Creator's ID
String? creatorUserID;
///
/// Group Type
int? groupType;
/// id
/// Owner's ID
String? ownerUserID;
///
/// Member Count
int? memberCount;
/// id
/// User ID Initiating the Group Join Request
String? userID;
///
/// User's Nickname Initiating the Group Join Request
String? nickname;
///
/// User's Avatar Initiating the Group Join Request
String? userFaceURL;
///
/// User's Gender Initiating the Group Join Request
int? gender;
/// -11
/// Handling Result: -1 - Rejected, 1 - Accepted
int? handleResult;
///
/// Request Description
String? reqMsg;
///
/// Handling Result Description
String? handledMsg;
///
/// Request Time
int? reqTime;
/// ID
/// Handler User ID
String? handleUserID;
///
/// Handling Time
int? handledTime;
///
/// Extra Information
String? ex;
/// 2 3 4
/// Join Source: 2 - Invited, 3 - Searched, 4 - QR Code
int? joinSource;
/// ID
/// Inviting User's ID
String? inviterUserID;
GroupApplicationInfo({
@ -409,6 +408,7 @@ class GroupApplicationInfo {
}
}
/// Group Invitation Result
class GroupInviteResult {
String? userID;
int? result;

@ -1,155 +0,0 @@
class MeetingInfoList {
List<MeetingInfo>? meetingInfoList;
MeetingInfoList({this.meetingInfoList});
MeetingInfoList.fromJson(Map<String, dynamic> json) {
if (json['meetingInfoList'] != null) {
meetingInfoList = <MeetingInfo>[];
json['meetingInfoList'].forEach((v) {
meetingInfoList!.add(MeetingInfo.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
if (this.meetingInfoList != null) {
data['meetingInfoList'] =
this.meetingInfoList!.map((v) => v.toJson()).toList();
}
return data;
}
}
class MeetingInfo {
String? roomID;
String? meetingName;
String? ex;
String? hostUserID;
List<String>? inviteeUserIDList; //
int? createTime;
int? startTime;
int? endTime;
bool? participantCanUnmuteSelf; //
bool? participantCanEnableVideo; //
bool? onlyHostInviteUser; //
bool? onlyHostShareScreen; //
bool? joinDisableMicrophone; //
bool? joinDisableVideo; //
bool? isMuteAllVideo; //
bool? isMuteAllMicrophone; //
List<String>? canScreenUserIDList; // ID列表
List<String>? disableMicrophoneUserIDList; // id列表
List<String>? disableVideoUserIDList; // ID列表
List<String>? pinedUserIDList; // ID列表
List<String>? beWatchedUserIDList; //
MeetingInfo({
this.roomID,
this.meetingName,
this.ex,
this.hostUserID,
this.inviteeUserIDList,
this.createTime,
this.startTime,
this.endTime,
this.participantCanUnmuteSelf,
this.participantCanEnableVideo,
this.onlyHostInviteUser,
this.onlyHostShareScreen,
this.joinDisableMicrophone,
this.joinDisableVideo,
this.isMuteAllVideo,
this.isMuteAllMicrophone,
this.canScreenUserIDList,
this.disableMicrophoneUserIDList,
this.disableVideoUserIDList,
this.pinedUserIDList,
this.beWatchedUserIDList,
});
MeetingInfo.fromJson(Map<String, dynamic> json) {
roomID = json['roomID'];
meetingName = json['meetingName'];
ex = json['ex'];
hostUserID = json['hostUserID'];
inviteeUserIDList = json['inviteeUserIDList'] == null
? null
: (json['inviteeUserIDList'] as List).cast<String>();
createTime = json['createTime'];
startTime = json['startTime'];
endTime = json['endTime'];
participantCanUnmuteSelf = json['participantCanUnmuteSelf'];
participantCanEnableVideo = json['participantCanEnableVideo'];
onlyHostInviteUser = json['onlyHostInviteUser'];
onlyHostShareScreen = json['onlyHostShareScreen'];
joinDisableMicrophone = json['joinDisableMicrophone'];
joinDisableVideo = json['joinDisableVideo'];
isMuteAllVideo = json['isMuteAllVideo'];
isMuteAllMicrophone = json['isMuteAllMicrophone'];
canScreenUserIDList = json['canScreenUserIDList'] == null
? null
: (json['canScreenUserIDList'] as List).cast<String>();
disableMicrophoneUserIDList = json['disableMicrophoneUserIDList'] == null
? null
: (json['disableMicrophoneUserIDList'] as List).cast<String>();
disableVideoUserIDList = json['disableVideoUserIDList'] == null
? null
: (json['disableVideoUserIDList'] as List).cast<String>();
pinedUserIDList = json['pinedUserIDList'] == null
? null
: (json['pinedUserIDList'] as List).cast<String>();
beWatchedUserIDList = json['beWatchedUserIDList'] == null
? null
: (json['beWatchedUserIDList'] as List).cast<String>();
}
Map<String, dynamic> toJson() {
final data = <String, dynamic>{};
data['roomID'] = roomID;
data['meetingName'] = meetingName;
data['ex'] = ex;
data['hostUserID'] = hostUserID;
data['inviteeUserIDList'] = inviteeUserIDList;
data['createTime'] = createTime;
data['startTime'] = startTime;
data['endTime'] = endTime;
data['participantCanUnmuteSelf'] = participantCanUnmuteSelf;
data['participantCanEnableVideo'] = participantCanEnableVideo;
data['onlyHostInviteUser'] = onlyHostInviteUser;
data['onlyHostShareScreen'] = onlyHostShareScreen;
data['joinDisableMicrophone'] = joinDisableMicrophone;
data['joinDisableVideo'] = joinDisableVideo;
data['isMuteAllVideo'] = isMuteAllVideo;
data['isMuteAllMicrophone'] = isMuteAllMicrophone;
data['canScreenUserIDList'] = canScreenUserIDList;
data['disableMicrophoneUserIDList'] = disableMicrophoneUserIDList;
data['disableVideoUserIDList'] = disableVideoUserIDList;
data['pinedUserIDList'] = pinedUserIDList;
data['beWatchedUserIDList'] = beWatchedUserIDList;
return data;
}
}
class MeetingStreamEvent {
String? roomID;
String? streamType;
bool? mute;
MeetingStreamEvent({this.roomID, this.streamType, this.mute});
MeetingStreamEvent.fromJson(Map<String, dynamic> json) {
roomID = json['roomID'];
streamType = json['streamType'];
mute = json['mute'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['roomID'] = this.roomID;
data['streamType'] = this.streamType;
data['mute'] = this.mute;
return data;
}
}

@ -3,116 +3,118 @@ import 'dart:io';
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class Message {
/// id
/// Message ID, a unique identifier.
String? clientMsgID;
/// id
/// Server-generated ID.
String? serverMsgID;
///
/// Creation time.
int? createTime;
///
/// Sending time.
int? sendTime;
/// [ConversationType]
/// Conversation type [ConversationType].
int? sessionType;
/// id
/// Sender's ID.
String? sendID;
/// id
/// Receiver's ID.
String? recvID;
///
/// Source.
int? msgFrom;
/// [MessageType]
/// Message type [MessageType].
int? contentType;
/// [Platform]
/// Platform [Platform].
int? senderPlatformID;
///
/// Sender's nickname.
String? senderNickname;
///
/// Sender's avatar.
String? senderFaceUrl;
/// ID
/// Group ID.
String? groupID;
///
// String? content;
/// Message content.
// String? content;
/// seq
/// Message sequence number.
int? seq;
///
/// Whether it's read.
bool? isRead;
///
/// Read time.
int? hasReadTime;
/// [MessageStatus]
/// Message sending status [MessageStatus].
int? status;
/// Is it a reaction.
bool? isReact;
/// Is it an external extension.
bool? isExternalExtensions;
/// 线
/// Offline display content.
OfflinePushInfo? offlinePush;
///
/// Additional information.
String? attachedInfo;
///
/// Extended information.
String? ex;
///
/// Custom extended information, currently used for message time segmentation on the client side.
Map<String, dynamic> exMap = {};
///
/// Image.
PictureElem? pictureElem;
///
/// Voice.
SoundElem? soundElem;
///
/// Video.
VideoElem? videoElem;
///
/// File.
FileElem? fileElem;
/// @
/// @ Information.
AtTextElem? atTextElem;
///
/// Location.
LocationElem? locationElem;
///
/// Custom.
CustomElem? customElem;
///
/// Quote.
QuoteElem? quoteElem;
///
/// Merge.
MergeElem? mergeElem;
///
/// Notification.
NotificationElem? notificationElem;
///
/// Custom emoji.
FaceElem? faceElem;
///
/// Additional information.
AttachedInfoElem? attachedInfoElem;
///
/// Text content.
TextElem? textElem;
///
/// Business card.
CardElem? cardElem;
///
@ -334,27 +336,27 @@ class Message {
typingElem = message.typingElem;
}
///
/// Single chat message
bool get isSingleChat => sessionType == ConversationType.single;
///
/// Group chat message
bool get isGroupChat =>
sessionType == ConversationType.group ||
sessionType == ConversationType.superGroup;
}
///
/// Image message content
class PictureElem {
///
/// Original path
String? sourcePath;
///
/// Original picture object
PictureInfo? sourcePicture;
///
/// Big picture object
PictureInfo? bigPicture;
///
/// Thumbnail picture object
PictureInfo? snapshotPicture;
PictureElem(
@ -392,24 +394,24 @@ class PictureElem {
}
}
///
/// Image information
class PictureInfo {
/// id
/// ID
String? uuid;
/// mime类型
/// Image MIME type
String? type;
///
/// Size
int? size;
///
/// Width
int? width;
///
/// Height
int? height;
/// URL地址
/// Image URL
String? url;
PictureInfo(
@ -436,21 +438,21 @@ class PictureInfo {
}
}
///
/// Voice message content
class SoundElem {
/// id
/// ID
String? uuid;
///
/// Original path
String? soundPath;
/// url地址
/// URL address
String? sourceUrl;
///
/// Size
int? dataSize;
/// s
/// Duration in seconds
int? duration;
SoundElem(
@ -479,42 +481,42 @@ class SoundElem {
}
}
///
/// Video message content
class VideoElem {
///
/// Video path
String? videoPath;
/// uuid
/// UUID
String? videoUUID;
/// url地址
/// URL address of the video
String? videoUrl;
/// mime类型
/// MIME type
String? videoType;
///
/// Size
int? videoSize;
/// s
/// Duration in seconds
int? duration;
///
/// Snapshot path
String? snapshotPath;
/// uuid
/// Snapshot UUID
String? snapshotUUID;
///
/// Snapshot size
int? snapshotSize;
/// URL地址
/// Snapshot URL address
String? snapshotUrl;
///
/// Snapshot width
int? snapshotWidth;
///
/// Snapshot height
int? snapshotHeight;
VideoElem(
@ -564,21 +566,21 @@ class VideoElem {
}
}
///
/// File message content
class FileElem {
///
/// File path
String? filePath;
/// uuid
/// UUID
String? uuid;
/// URL地址
/// File URL address
String? sourceUrl;
///
/// File name
String? fileName;
///
/// File size
int? fileSize;
FileElem(
@ -603,21 +605,21 @@ class FileElem {
}
}
/// @
/// @ Message Content
class AtTextElem {
///
/// Message content
String? text;
/// @ID列表
/// List of user IDs mentioned in the message
List<String>? atUserList;
///
/// Whether it includes a mention of oneself
bool? isAtSelf;
/// @ID跟昵称关系列表id替换为昵称显示
/// List of user IDs and their nicknames mentioned in the message, used to replace user IDs with nicknames in the message content
List<AtUserInfo>? atUsersInfo;
/// @
/// Message that is being replied to, when replying to someone and mentioning others
Message? quoteMessage;
AtTextElem({
@ -655,15 +657,15 @@ class AtTextElem {
}
}
///
/// Location Message
class LocationElem {
///
/// Location description
String? description;
///
/// Longitude
double? longitude;
///
/// Latitude
double? latitude;
LocationElem({this.description, this.longitude, this.latitude});
@ -692,15 +694,15 @@ class LocationElem {
}
}
///
/// Custom Message
class CustomElem {
///
/// Custom data
String? data;
///
/// Extended content
String? extension;
///
/// Description
String? description;
CustomElem({this.data, this.extension, this.description});
@ -720,12 +722,12 @@ class CustomElem {
}
}
///
/// Quoted Message (Reply to a message)
class QuoteElem {
///
/// Reply content
String? text;
///
/// The message being replied to
Message? quoteMessage;
QuoteElem({this.text, this.quoteMessage});
@ -745,15 +747,15 @@ class QuoteElem {
}
}
///
/// Merged Message Body
class MergeElem {
///
/// Title
String? title;
///
/// Summary
List<String>? abstractList;
///
/// List of specific messages to merge
List<Message>? multiMessage;
MergeElem({this.title, this.abstractList, this.multiMessage});
@ -779,12 +781,12 @@ class MergeElem {
}
}
///
/// Notification
class NotificationElem {
///
/// Details
String? detail;
///
/// Default tips
String? defaultTips;
NotificationElem({this.detail, this.defaultTips});
@ -802,12 +804,12 @@ class NotificationElem {
}
}
///
/// Emoticon
class FaceElem {
///
/// Position emoticon, user-defined embedded emoticon for peer-to-peer communication
int? index;
/// URL表情直接返回url
/// Other emoticons, such as URL emoticons directly returning the URL
String? data;
FaceElem({this.index, this.data});
@ -825,22 +827,22 @@ class FaceElem {
}
}
///
/// Additional Information
class AttachedInfoElem {
///
/// Group message read information
GroupHasReadInfo? groupHasReadInfo;
///
/// Whether it is a private chat message (burn after reading message), valid for one-on-one chats
bool? isPrivateChat;
///
/// Read time
int? hasReadTime;
/// s
/// hasReadTime时间算起burnDuration秒触发销毁
/// Reading duration in seconds
/// That is, it triggers destruction after burnDuration seconds from the hasReadTime time
int? burnDuration;
/// 线
/// Do not send offline push notifications
bool? notSenderNotificationPush;
AttachedInfoElem({
@ -981,15 +983,15 @@ class MessageEntity {
}
}
///
/// Group message read information
class GroupHasReadInfo {
/// id列表
/// List of user IDs that have read the message
List<String>? hasReadUserIDList;
///
/// Total number of messages read
int? hasReadCount;
///
/// Number of group members when this message was sent
int? groupMemberCount;
GroupHasReadInfo.fromJson(Map<String, dynamic> json) {
@ -1011,27 +1013,27 @@ class GroupHasReadInfo {
}
}
///
/// Message read receipt information
class ReadReceiptInfo {
/// id
/// Sender's ID
String? userID;
/// id
/// Group ID
String? groupID;
/// clientMsgID集合
/// List of clientMsgIDs for read messages
List<String>? msgIDList;
///
/// Read time
int? readTime;
///
/// Message source
int? msgFrom;
/// [MessageType]
/// Message type [MessageType]
int? contentType;
/// [ConversationType]
/// Conversation type [ConversationType]
int? sessionType;
ReadReceiptInfo(
@ -1067,21 +1069,21 @@ class ReadReceiptInfo {
}
}
/// 线
/// Offline push information
class OfflinePushInfo {
///
/// Notification title
String? title;
///
/// Notification description
String? desc;
///
/// Extended content
String? ex;
/// ios有效
/// iOS-specific
String? iOSPushSound;
/// ios有效
/// iOS-specific
bool? iOSBadgeCount;
OfflinePushInfo(
@ -1106,12 +1108,12 @@ class OfflinePushInfo {
}
}
/// @id跟昵称关系对象
/// @ message user ID and nickname relationship object
class AtUserInfo {
/// @id
/// User ID who was @ mentioned
String? atUserID;
/// @
/// User nickname who was @ mentioned
String? groupNickname;
AtUserInfo({this.atUserID, this.groupNickname});
@ -1129,33 +1131,33 @@ class AtUserInfo {
}
}
///
/// Message revocation details
class RevokedInfo {
/// ID
/// Revoker's ID
String? revokerID;
/// [GroupRoleLevel]
/// Revoker's group role [GroupRoleLevel]
int? revokerRole;
///
/// Revoker's nickname
String? revokerNickname;
/// id
/// Message ID
String? clientMsgID;
///
/// Revocation time
int? revokeTime;
///
/// Message sending time
int? sourceMessageSendTime;
///
/// Message sender
String? sourceMessageSendID;
///
/// Message sender's nickname
String? sourceMessageSenderNickname;
/// [ConversationType]
/// Conversation type [ConversationType]
int? sessionType;
RevokedInfo({
@ -1269,31 +1271,6 @@ class RichMessageInfo {
}
}
///////////////////// /////////////////////
////////////////////////////////////////////////////
class KeyValue {
String? typeKey;
String? value;
int? latestUpdateTime;
KeyValue({this.typeKey, this.value, this.latestUpdateTime});
KeyValue.fromJson(Map<String, dynamic> json) {
typeKey = json['typeKey'];
value = json['value'];
latestUpdateTime = json['latestUpdateTime'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['typeKey'] = this.typeKey;
data['value'] = this.value;
data['latestUpdateTime'] = this.latestUpdateTime;
return data;
}
}
class UserExInfo {
String? userID;
String? ex;
@ -1312,129 +1289,3 @@ class UserExInfo {
return data;
}
}
class SingleTypeKeyInfoSum {
String? typeKey;
int? counter;
List<UserExInfo>? infoList;
bool? isContainSelf;
SingleTypeKeyInfoSum({
this.typeKey,
this.counter,
this.infoList,
this.isContainSelf,
});
SingleTypeKeyInfoSum.fromJson(Map<String, dynamic> json) {
typeKey = json['typeKey'];
counter = json['counter'];
infoList = json['infoList'] == null
? null
: (json['infoList'] as List)
.map((e) => UserExInfo.fromJson(e))
.toList();
isContainSelf = json['isContainSelf'];
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['typeKey'] = this.typeKey;
data['counter'] = this.counter;
data['infoList'] = this.infoList?.map((e) => e.toJson()).toList();
data['isContainSelf'] = this.isContainSelf;
return data;
}
}
class MessageKv {
String? clientMsgID;
List<SingleTypeKeyInfoSum>? changedKvList;
MessageKv({this.clientMsgID, this.changedKvList});
MessageKv.fromJson(Map<String, dynamic> json) {
clientMsgID = json['clientMsgID'];
changedKvList = json['changedKvList'] == null
? null
: (json['changedKvList'] as List)
.map((e) => SingleTypeKeyInfoSum.fromJson(e))
.toList();
}
Map<String, dynamic> toJson() {
final data = Map<String, dynamic>();
data['clientMsgID'] = this.clientMsgID;
data['changedKvList'] = this.changedKvList?.map((e) => e.toJson()).toList();
return data;
}
}
class TypeKeySetResult {
int? errCode;
String? errMsg;
String? typeKey;
int? latestUpdateTime;
String? value;
TypeKeySetResult(
{this.errCode,
this.errMsg,
this.typeKey,
this.latestUpdateTime,
this.value});
TypeKeySetResult.fromJson(Map<String, dynamic> json) {
errCode = json['errCode'];
errMsg = json['errMsg'];
typeKey = json['typeKey'];
latestUpdateTime = json['latestUpdateTime'];
value = json['value'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['errCode'] = this.errCode;
data['errMsg'] = this.errMsg;
data['typeKey'] = this.typeKey;
data['latestUpdateTime'] = this.latestUpdateTime;
data['value'] = this.value;
return data;
}
}
class MessageTypeKeyMapping {
int? errCode;
String? errMsg;
Map<String, KeyValue>? reactionExtensionList;
String? clientMsgID;
MessageTypeKeyMapping(
{this.errCode,
this.errMsg,
this.reactionExtensionList,
this.clientMsgID});
MessageTypeKeyMapping.fromJson(Map<String, dynamic> json) {
errCode = json['errCode'];
errMsg = json['errMsg'];
reactionExtensionList = json['reactionExtensionList'] != null
? (json['reactionExtensionList'] as Map)
.map((key, value) => MapEntry(key, KeyValue.fromJson(value)))
: null;
clientMsgID = json['clientMsgID'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['errCode'] = this.errCode;
data['errMsg'] = this.errMsg;
if (this.reactionExtensionList != null) {
data['reactionExtensionList'] = this
.reactionExtensionList!
.map((key, value) => MapEntry(key, value.toJson()));
}
data['clientMsgID'] = this.clientMsgID;
return data;
}
}

@ -1,38 +1,41 @@
import '../../flutter_openim_sdk.dart';
/// oa
/// OA notification
class OANotification {
///
/// Title
String? notificationName;
///
/// Avatar
String? notificationFaceURL;
///
/// Type
int? notificationType;
///
/// Text content
String? text;
///
/// Redirect link
String? externalUrl;
/// 0 1+ 2+ 3+
/// 0: Text-only notification
/// 1: Text + Image notification
/// 2: Text + Video notification
/// 3: Text + File notification
int? mixType;
///
/// Image information
PictureElem? pictureElem;
///
/// Sound information
SoundElem? soundElem;
///
/// Video information
VideoElem? videoElem;
///
/// File information
FileElem? fileElem;
///
/// Additional field
String? ex;
OANotification(

@ -1,10 +1,10 @@
import 'package:flutter_openim_sdk/flutter_openim_sdk.dart';
class SearchResult {
///
/// Total number of messages obtained
int? totalCount;
///
/// Specific search results
List<SearchResultItems>? searchResultItems;
List<SearchResultItems>? findResultItems;
@ -43,22 +43,22 @@ class SearchResult {
}
class SearchResultItems {
/// ID
/// Conversation ID
String? conversationID;
/// 1234
/// Conversation type: 1 for single chat, 2 for group chat, 3 for supergroup, 4 for notification conversation
int? conversationType;
///
/// Display name
String? showName;
///
/// Profile picture
String? faceURL;
///
/// Number of messages found in this conversation
int? messageCount;
/// [Message]
/// List of [Message]s
List<Message>? messageList;
SearchResultItems({this.conversationID, this.messageCount, this.messageList});

@ -1,68 +1,71 @@
/// Is a friend not in the blacklist
///
/// Not a friend on the blacklist
///
/// Not a friend is not on the blacklist
///
class UserInfo {
/// id
/// User ID
String? userID;
///
/// User nickname
String? nickname;
///
/// Profile picture
String? faceURL;
///
/// Gender
int? gender;
///
/// Phone number
String? phoneNumber;
///
/// Date of birth
int? birth;
///
/// Email
String? email;
///
/// Additional information
String? ex;
///
/// Creation time
int? createTime;
///
/// Remark
String? remark;
/// 012线线
/// Global do not disturb setting:
/// 0: Normal
/// 1: Do not accept messages
/// 2: Accept online messages but not offline messages
int? globalRecvMsgOpt;
/// 12
/// Allow adding as a friend:
/// 1: Allowed
/// 2: Not allowed
int? allowAddFriend;
/// 12
/// New message ringtone:
/// 1: Allowed
/// 2: Not allowed
int? allowBeep;
/// 12
/// New message vibration:
/// 1: Allowed
/// 2: Not allowed
int? allowVibration;
///
/// Prohibited from logging in
int? forbidden;
///
/// User's public information
PublicUserInfo? publicInfo;
///
/// Information visible only to friends
FriendInfo? friendInfo;
///
/// Blacklist information
BlacklistInfo? blackInfo;
///
/// Whether there is a friendship relationship
bool? isFriendship;
///
/// Whether the user is in the blacklist
bool? isBlacklist;
UserInfo({
@ -89,23 +92,17 @@ class UserInfo {
this.forbidden,
});
// UserInfo.self(Map<String, dynamic> json) {
// userID = json['userID'];
// nickname = json['nickname'];
// faceURL = json['faceURL'];
// gender = json['gender'];
// phoneNumber = json['phoneNumber'];
// birth = json['birth'];
// email = json['email'];
// ex = json['ex'];
// createTime = json['createTime'];
// }
UserInfo.fromJson(Map<String, dynamic> json) {
publicInfo = json['publicInfo'] != null ? PublicUserInfo.fromJson(json['publicInfo']) : null;
friendInfo = json['friendInfo'] != null ? FriendInfo.fromJson(json['friendInfo']) : null;
blackInfo = json['blackInfo'] != null ? BlacklistInfo.fromJson(json['blackInfo']) : null;
//
publicInfo = json['publicInfo'] != null
? PublicUserInfo.fromJson(json['publicInfo'])
: null;
friendInfo = json['friendInfo'] != null
? FriendInfo.fromJson(json['friendInfo'])
: null;
blackInfo = json['blackInfo'] != null
? BlacklistInfo.fromJson(json['blackInfo'])
: null;
isFriendship = friendInfo != null;
isBlacklist = blackInfo != null;
@ -152,23 +149,27 @@ class UserInfo {
return data;
}
// bool get isFriendship => null != friendInfo;
//
// bool get isBlacklist => null != blackInfo;
bool get isMale => gender == 1;
String get _userID => isFriendship! ? friendInfo!.userID! : (isBlacklist! ? blackInfo!.userID! : publicInfo!.userID!);
String get _userID => isFriendship!
? friendInfo!.userID!
: (isBlacklist! ? blackInfo!.userID! : publicInfo!.userID!);
String? get _nickname =>
isFriendship! ? friendInfo?.nickname : (isBlacklist! ? blackInfo?.nickname : publicInfo?.nickname);
String? get _nickname => isFriendship!
? friendInfo?.nickname
: (isBlacklist! ? blackInfo?.nickname : publicInfo?.nickname);
String? get _faceUrl =>
isFriendship! ? friendInfo?.faceURL : (isBlacklist! ? blackInfo?.faceURL : publicInfo?.faceURL);
String? get _faceUrl => isFriendship!
? friendInfo?.faceURL
: (isBlacklist! ? blackInfo?.faceURL : publicInfo?.faceURL);
int? get _gender => isFriendship! ? friendInfo?.gender : (isBlacklist! ? blackInfo?.gender : publicInfo?.gender);
int? get _gender => isFriendship!
? friendInfo?.gender
: (isBlacklist! ? blackInfo?.gender : publicInfo?.gender);
String? get _ex => isFriendship! ? friendInfo?.ex : (isBlacklist! ? blackInfo?.ex : publicInfo?.ex);
String? get _ex => isFriendship!
? friendInfo?.ex
: (isBlacklist! ? blackInfo?.ex : publicInfo?.ex);
String? get _phoneNumber => friendInfo?.phoneNumber;
@ -187,30 +188,34 @@ class UserInfo {
@override
bool operator ==(Object other) =>
identical(this, other) || other is UserInfo && runtimeType == other.runtimeType && userID == other.userID;
identical(this, other) ||
other is UserInfo &&
runtimeType == other.runtimeType &&
userID == other.userID;
@override
int get hashCode => userID.hashCode;
}
///
class PublicUserInfo {
/// id
/// User ID
String? userID;
///
/// Nickname
String? nickname;
///
/// Profile picture
String? faceURL;
///
/// Gender
int? gender;
/// AppOrdinaryUsers = 1 AppAdmin = 2
int? appMangerLevel;
/// App Manager Level:
/// 1: AppOrdinaryUsers
/// 2: AppAdmin
int? appManagerLevel;
///
/// Additional information
String? ex;
PublicUserInfo({
@ -218,7 +223,7 @@ class PublicUserInfo {
this.nickname,
this.faceURL,
this.gender,
this.appMangerLevel,
this.appManagerLevel,
this.ex,
});
@ -227,7 +232,7 @@ class PublicUserInfo {
nickname = json['nickname'];
faceURL = json['faceURL'];
gender = json['gender'];
appMangerLevel = json['appMangerLevel'];
appManagerLevel = json['appManagerLevel'];
ex = json['ex'];
}
@ -237,48 +242,47 @@ class PublicUserInfo {
data['nickname'] = this.nickname;
data['faceURL'] = this.faceURL;
data['gender'] = this.gender;
data['appMangerLevel'] = this.appMangerLevel;
data['appMangerLevel'] = this.appManagerLevel;
data['ex'] = this.ex;
return data;
}
}
///
class FriendInfo {
/// id
/// User ID
String? userID;
///
/// Nickname
String? nickname;
///
/// Profile picture
String? faceURL;
///
/// Gender
int? gender;
///
/// Phone number
String? phoneNumber;
///
/// Date of birth
int? birth;
///
/// Email
String? email;
///
/// Remark
String? remark;
///
/// Additional information
String? ex;
///
/// Creation time
int? createTime;
///
/// Add source
int? addSource;
/// id
/// Operator User ID
String? operatorUserID;
FriendInfo({
@ -338,30 +342,29 @@ class FriendInfo {
}
}
///
class BlacklistInfo {
/// id
/// User ID
String? userID;
///
/// Nickname
String? nickname;
///
/// Profile picture
String? faceURL;
///
/// Gender
int? gender;
///
/// Creation time
int? createTime;
///
/// Add source
int? addSource;
///
/// Operator User ID
String? operatorUserID;
///
/// Additional information
String? ex;
BlacklistInfo({
@ -400,12 +403,11 @@ class BlacklistInfo {
}
}
///
class FriendshipInfo {
/// id
/// User ID
String? userID;
/// 1
/// 1 represents a friend (and not in the blacklist)
int? result;
FriendshipInfo({this.userID, this.result});
@ -423,51 +425,50 @@ class FriendshipInfo {
}
}
///
class FriendApplicationInfo {
/// id
/// Initiator user ID
String? fromUserID;
///
/// Initiator user nickname
String? fromNickname;
///
/// Initiator user profile picture
String? fromFaceURL;
///
/// Initiator user gender
int? fromGender;
/// id
/// Recipient user ID
String? toUserID;
///
/// Recipient user nickname
String? toNickname;
///
/// Recipient user profile picture
String? toFaceURL;
///
/// Recipient user gender
int? toGender;
///
/// Handling result
int? handleResult;
///
/// Request message
String? reqMsg;
///
/// Creation time
int? createTime;
/// id
/// Handler user ID
String? handlerUserID;
///
/// Handling remark
String? handleMsg;
///
/// Handling time
int? handleTime;
///
/// Additional information
String? ex;
FriendApplicationInfo(
@ -525,24 +526,24 @@ class FriendApplicationInfo {
return data;
}
///
/// Waiting to be processed
bool get isWaitingHandle => handleResult == 0;
///
/// Already agreed
bool get isAgreed => handleResult == 1;
///
/// Already rejected
bool get isRejected => handleResult == -1;
}
class UserStatusInfo {
/// id
/// User ID
String? userID;
///
/// Status
int? status;
/// ID
/// Platform IDs
List<int>? platformIDs;
UserStatusInfo({
@ -554,7 +555,9 @@ class UserStatusInfo {
UserStatusInfo.fromJson(Map<String, dynamic> json) {
userID = json['userID'];
status = json['status'];
platformIDs = json["platformIDs"] == null ? [] : List<int>.from(json["platformIDs"].map((x) => x));
platformIDs = json["platformIDs"] == null
? []
: List<int>.from(json["platformIDs"].map((x) => x));
}
Map<String, dynamic> toJson() {

@ -6,7 +6,7 @@ packages:
description:
name: async
sha256: bfe67ef28df125b7dddcea62755991f807aa39a2492a23e1550161692950bbe0
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.10.0"
boolean_selector:
@ -14,7 +14,7 @@ packages:
description:
name: boolean_selector
sha256: "6cfb5af12253eaf2b368f07bacc5a80d1301a071c73360d746b7f2e32d762c66"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
characters:
@ -22,7 +22,7 @@ packages:
description:
name: characters
sha256: e6a326c8af69605aec75ed6c187d06b349707a27fbff8222ca9cc2cff167975c
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
clock:
@ -30,7 +30,7 @@ packages:
description:
name: clock
sha256: cb6d7f03e1de671e34607e909a7213e31d7752be4fb66a86d29fe1eb14bfb5cf
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.1.1"
collection:
@ -38,7 +38,7 @@ packages:
description:
name: collection
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.17.0"
fake_async:
@ -46,7 +46,7 @@ packages:
description:
name: fake_async
sha256: "511392330127add0b769b75a987850d136345d9227c6b94c96a04cf4a391bf78"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.3.1"
flutter:
@ -64,7 +64,7 @@ packages:
description:
name: js
sha256: "5528c2f391ededb7775ec1daa69e65a2d61276f7552de2b5f7b8d34ee9fd4ab7"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.6.5"
matcher:
@ -72,7 +72,7 @@ packages:
description:
name: matcher
sha256: "16db949ceee371e9b99d22f88fa3a73c4e59fd0afed0bd25fc336eb76c198b72"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.12.13"
material_color_utilities:
@ -80,7 +80,7 @@ packages:
description:
name: material_color_utilities
sha256: d92141dc6fe1dad30722f9aa826c7fbc896d021d792f80678280601aff8cf724
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.2.0"
meta:
@ -88,7 +88,7 @@ packages:
description:
name: meta
sha256: "6c268b42ed578a53088d834796959e4a1814b5e9e164f147f580a386e5decf42"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.8.0"
path:
@ -96,7 +96,7 @@ packages:
description:
name: path
sha256: db9d4f58c908a4ba5953fcee2ae317c94889433e5024c27ce74a37f94267945b
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.8.2"
sky_engine:
@ -109,7 +109,7 @@ packages:
description:
name: source_span
sha256: dd904f795d4b4f3b870833847c461801f6750a9fa8e61ea5ac53f9422b31f250
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.9.1"
stack_trace:
@ -117,7 +117,7 @@ packages:
description:
name: stack_trace
sha256: c3c7d8edb15bee7f0f74debd4b9c5f3c2ea86766fe4178eb2a18eb30a0bdaed5
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.11.0"
stream_channel:
@ -125,7 +125,7 @@ packages:
description:
name: stream_channel
sha256: "83615bee9045c1d322bbbd1ba209b7a749c2cbcdcb3fdd1df8eb488b3279c1c8"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.1"
string_scanner:
@ -133,7 +133,7 @@ packages:
description:
name: string_scanner
sha256: "556692adab6cfa87322a115640c11f13cb77b3f076ddcc5d6ae3c20242bedcde"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.2.0"
term_glyph:
@ -141,7 +141,7 @@ packages:
description:
name: term_glyph
sha256: a29248a84fbb7c79282b40b8c72a1209db169a2e0542bce341da992fe1bc7e84
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "1.2.1"
test_api:
@ -149,7 +149,7 @@ packages:
description:
name: test_api
sha256: ad540f65f92caa91bf21dfc8ffb8c589d6e4dc0c2267818b4cc2792857706206
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "0.4.16"
vector_math:
@ -157,7 +157,7 @@ packages:
description:
name: vector_math
sha256: "80b3257d1492ce4d091729e3a67a60407d227c27241d6927be0130c98e741803"
url: "https://pub.flutter-io.cn"
url: "https://pub.dev"
source: hosted
version: "2.1.4"
sdks:

Loading…
Cancel
Save